tmp/tmpvd8i_x7u/{from.md → to.md}
RENAMED
|
@@ -3,13 +3,13 @@
|
|
| 3 |
**Change:** It is now invalid to jump past a declaration with explicit
|
| 4 |
or implicit initializer (except across entire block not entered).
|
| 5 |
**Rationale:** Constructors used in initializers may allocate resources
|
| 6 |
which need to be de-allocated upon leaving the block. Allowing jump past
|
| 7 |
initializers would require complicated runtime determination of
|
| 8 |
-
allocation. Furthermore,
|
| 9 |
-
|
| 10 |
-
initialized variable is in scope, then it has assuredly been
|
| 11 |
initialized. **Effect on original feature:** Deletion of semantically
|
| 12 |
well-defined feature. Semantic transformation. Seldom.
|
| 13 |
|
| 14 |
**Change:** It is now invalid to return (explicitly or implicitly) from
|
| 15 |
a function which is declared to return a value without actually
|
|
@@ -17,12 +17,12 @@ returning a value. **Rationale:** The caller and callee may assume
|
|
| 17 |
fairly elaborate return-value mechanisms for the return of class
|
| 18 |
objects. If some flow paths execute a return without specifying any
|
| 19 |
value, the implementation must embody many more complications. Besides,
|
| 20 |
promising to return a value of a given type, and then not returning such
|
| 21 |
a value, has always been recognized to be a questionable practice,
|
| 22 |
-
tolerated only because very-old C had no distinction between
|
| 23 |
-
|
| 24 |
-
semantically well-defined feature. Semantic transformation.
|
| 25 |
-
appropriate return value to the source code, such as zero.
|
| 26 |
-
several years, many existing C implementations have produced
|
| 27 |
-
this case.
|
| 28 |
|
|
|
|
| 3 |
**Change:** It is now invalid to jump past a declaration with explicit
|
| 4 |
or implicit initializer (except across entire block not entered).
|
| 5 |
**Rationale:** Constructors used in initializers may allocate resources
|
| 6 |
which need to be de-allocated upon leaving the block. Allowing jump past
|
| 7 |
initializers would require complicated runtime determination of
|
| 8 |
+
allocation. Furthermore, many operations on such an uninitialized object
|
| 9 |
+
have undefined behavior. With this simple compile-time rule, C++ assures
|
| 10 |
+
that if an initialized variable is in scope, then it has assuredly been
|
| 11 |
initialized. **Effect on original feature:** Deletion of semantically
|
| 12 |
well-defined feature. Semantic transformation. Seldom.
|
| 13 |
|
| 14 |
**Change:** It is now invalid to return (explicitly or implicitly) from
|
| 15 |
a function which is declared to return a value without actually
|
|
|
|
| 17 |
fairly elaborate return-value mechanisms for the return of class
|
| 18 |
objects. If some flow paths execute a return without specifying any
|
| 19 |
value, the implementation must embody many more complications. Besides,
|
| 20 |
promising to return a value of a given type, and then not returning such
|
| 21 |
a value, has always been recognized to be a questionable practice,
|
| 22 |
+
tolerated only because very-old C had no distinction between functions
|
| 23 |
+
with `void` and `int` return types. **Effect on original feature:**
|
| 24 |
+
Deletion of semantically well-defined feature. Semantic transformation.
|
| 25 |
+
Add an appropriate return value to the source code, such as zero.
|
| 26 |
+
Seldom. For several years, many existing C implementations have produced
|
| 27 |
+
warnings in this case.
|
| 28 |
|