This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Storage for uninitialized objects (PR 24626)
- From: Gabriel Dos Reis <gdr at cs dot tamu dot edu>
- To: Paul Schlie <schlie at comcast dot net>
- Cc: Ian Lance Taylor <ian at airs dot com>, John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>, <gcc at gcc dot gnu dot org>
- Date: 15 Jan 2006 07:49:33 -0600
- Subject: Re: Storage for uninitialized objects (PR 24626)
- References: <BFEF9CD9.CACF%schlie@comcast.net>
Paul Schlie <schlie@comcast.net> writes:
| Thank you for the explanation.
|
| Given that it would appear that the only time the compiler may attempt
| to optimize the allocation/use of an un-initialized variable, is when it
| knows for certain it hasn't been initialized; might it be preferable to
| then assign it a deterministic cheap value such as 0 which it may then
| presume during optimization, given all remaining alternatives would seem
| to have less desirable potential consequences?
Reasonable people have different reasonable ideas of "cheap value".
I heard that some compilers in the past used the value 0xdeadbeef for
uninitialized pointers.
-- Gaby