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: Andreas Schwab <schwab at suse dot de>
- Cc: Steven Bosscher <steven at gcc dot gnu dot org>, gcc at gcc dot gnu dot org, Robert Dewar <dewar at adacore dot com>, Paul Schlie <schlie at comcast dot net>, Ian Lance Taylor <ian at airs dot com>, John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>, jsm28 at gcc dot gnu dot org
- Date: 15 Jan 2006 07:41:05 -0600
- Subject: Re: Storage for uninitialized objects (PR 24626)
- References: <BFEF7F1F.CABE%schlie@comcast.net> <43CA1764.5070907@adacore.com> <200601151059.27135.steven@gcc.gnu.org> <jemzhx3hii.fsf@sykes.suse.de>
Andreas Schwab <schwab@suse.de> writes:
| Steven Bosscher <steven@gcc.gnu.org> writes:
|
| > A more explicit statement about using uninitialized variables is in
| > appendix J.2 ("Undefined behavior"):
| >
| > "The behavior is undefined in the following circumstances:
| > (...snip...)
| > - The value of an object with automatic storage duration is used
| > while it is indeterminate (6.2.4, 6.7.8, 6.8)."
|
| The value indeterminate value of the variable can be a trap
| representation, thus the mere use of it can crash the program.
except when it is has character type, or when the expression used to
access the value is an lvalue of character type.
-- Gaby