Add Proposal | Add Analysis | Edit Class, Environment, or Release |
Number | 105
|
Category | errata
|
Synopsis | 10.3: return value of automatic function not initialized
|
State | open
|
Class | errata-discuss
|
Arrival-Date | Aug 22 2002
|
Originator | sharp@cadence.com
|
Release | 2001b: 10.3
|
Environment |
#100 |
Description |
This is related to erratum 100. Section 10.2.3 specifies that variables declared in automatic functions shall be initialized to the default initialization value whenever execution enters their scope. However, it does not specify initialization for the function return value. It is possible for a function to exit without having set its return value. In the case of automatic functions, that leaves the return value undefined. |
Fix |
Specify that the return value of an automatic function shall be initialized to the default initialization value whenever the function begins executing. |
Audit-Trail |
From: Shalom Bresticker <Shalom.Bresticker@motorola.com> To: sharp@cadence.com Cc: etf-bugs@boyd.com Subject: Re: errata/105: return value of automatic function not initialized Date: Sun, 25 Aug 2002 11:13:07 +0300 Functions are discussed in 10.3, not 10.2. Actually, I do not find in 10.3 a statement parallel to the one you mention from 10.2.3. With respect to the function return value, 10.3.2 says, "The function definition initializes the return value ... by assigning the function result to the internal variable with the same name as the function." I think the term "initializes" is poor here, because it is not initialization, but rather an assignment. 10.3.4(e) says, "A function definition shall include an assignment of the function result value to the internal variable that has the same name as the function name." However, it is true that nothing guarantees that this assignment will actually be executed. A sentence similar to the one in 10.3.2 should appear here also. As in errata/100, it should state that it applies also to the output argument. The sentence I quoted from 10.3.2 should be modified to not use the word "initializes". Shalom sharp@cadence.com wrote: > > This is related to erratum 100. > > Section 10.2.3 specifies that variables declared in > automatic functions shall be initialized to the default > initialization value whenever execution enters their > scope. However, it does not specify initialization for > the function return value. It is possible for a function > to exit without having set its return value. In the case > of automatic functions, that leaves the return value > undefined. |
Unformatted |
|
Hosted by Boyd Technology