Re: class object initialisation
On Mon, 15 Sep 2003 14:14:13 +0300, "Attila Feher"
<attila.feher@l mf.ericsson.se> wrote:
[color=blue]
>Karl Heinz Buchegger wrote:[color=green]
>> Ying Yang wrote:[color=darkred]
>>>
>>>
>>> int i; //declared but not initialised[/color]
>>
>> wrong. initialized to an undetermined value. Initialization.[/color]
>
>
>Wrong. This i, if it has an automatic storage, is not initialized.
>Accessing it for anything else then writing (assigment or initialization) it
>(well, reading it in any way) is undefined behavior.[/color]
The lvalue to rvalue conversion is undefined for indeterminate values
(use of the term "initialize d" has been recognized as a defect in the
standard).
According to other parts of the standard (see my other posts), the
above does count as initialization to an indeterminate value.
Tom
On Mon, 15 Sep 2003 14:14:13 +0300, "Attila Feher"
<attila.feher@l mf.ericsson.se> wrote:
[color=blue]
>Karl Heinz Buchegger wrote:[color=green]
>> Ying Yang wrote:[color=darkred]
>>>
>>>
>>> int i; //declared but not initialised[/color]
>>
>> wrong. initialized to an undetermined value. Initialization.[/color]
>
>
>Wrong. This i, if it has an automatic storage, is not initialized.
>Accessing it for anything else then writing (assigment or initialization) it
>(well, reading it in any way) is undefined behavior.[/color]
The lvalue to rvalue conversion is undefined for indeterminate values
(use of the term "initialize d" has been recognized as a defect in the
standard).
According to other parts of the standard (see my other posts), the
above does count as initialization to an indeterminate value.
Tom
Comment