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: Andreas Schwab <schwab at suse dot de>
- To: Steven Bosscher <steven at gcc dot gnu dot org>
- Cc: 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: Sun, 15 Jan 2006 11:36:05 +0100
- Subject: Re: Storage for uninitialized objects (PR 24626)
- References: <BFEF7F1F.CABE%schlie@comcast.net> <43CA1764.5070907@adacore.com> <200601151059.27135.steven@gcc.gnu.org>
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.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."