home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.std.c:3290 comp.lang.c:19029
- Newsgroups: comp.std.c,comp.lang.c
- Path: sparky!uunet!taumet!mike
- From: mike@taumet.com (Mike Ball)
- Subject: Re: uninitialized++;
- Message-ID: <1992Dec30.172142.22789@taumet.com>
- Organization: TauMetric Corporation
- References: <HBF.92Dec29211517@gandalf.uio.no> <9236508.13290@mulga.cs.mu.OZ.AU> <C02DDv.2Kw@jrd.dec.com>
- Date: Wed, 30 Dec 1992 17:21:42 GMT
- Lines: 21
-
- diamond@jit533.jit.dec.com (Norman Diamond) writes:
-
- >In article <9236508.13290@mulga.cs.mu.OZ.AU> fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
- >>hbf@gandalf.uio.no (Hallvard B Furuseth) writes:
- >>>Can this fail - on some machine? - in ANSI?
- > main () { int uninitialized; uninitialized += 0; return 0; }
- >I think this one is not allowed to fail.
-
- To quote from the standard., section 1.6
- "Undefined behavior - behavior, upon use of a nonportable or erroneous
- program construct, or erroneous data, or of indeterminately valued objects,
- for which the standard imposes no requirements."
-
- And 3.5.7
- "If an object that has automatic storage duration is not initialized
- explicitly, its value is indeterminate."
-
- Sounds like any use of the value, even adding 0, is undefined.
- --
- Michael S. Ball (mike@taumet.com)
- TauMetric Corporation
-