home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / std / c / 3290 < prev    next >
Encoding:
Internet Message Format  |  1992-12-30  |  1.2 KB

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