home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / linux / 22062 < prev    next >
Encoding:
Internet Message Format  |  1992-12-29  |  2.1 KB

  1. Path: sparky!uunet!gatech!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!news.funet.fi!hydra!klaava!wirzeniu
  2. From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
  3. Newsgroups: comp.os.linux
  4. Subject: Re: IMPORTANT [BUG in 0.99] Re: [ANNOUNCE]: linux version 0.99
  5. Message-ID: <1992Dec29.201449.22375@klaava.Helsinki.FI>
  6. Date: 29 Dec 92 20:14:49 GMT
  7. References: <1992Dec19.222324.22106@klaava.Helsinki.FI> <1hpsasINN6e@meaddata.meaddata.com>
  8. Organization: University of Helsinki
  9. Lines: 43
  10.  
  11. sdw@meaddata.com (Stephen Williams) writes:
  12. >Statics are either explicitly initialized or they are not.
  13. >If they are not, their contents are UNDEFINED until set.
  14. >This is per ANSI C.
  15. >
  16. >There is NO requirement of the compiler or system to zero
  17. >un-initialized statics (or auto's).
  18.  
  19. Chapter and verse, friend, chapter and verse.  I want you to give the
  20. chapter and verse in the ANSI or the ISO C standard (they are the
  21. same, except that their chapters and verses are numbered differently)
  22. that says that statics are not initialized to zero unless explicitly
  23. initialized to something else.  (I agree about the part about auto's,
  24. though.)
  25.  
  26. I don't have the standard (I'm way too poor to afford it), but K&R 1
  27. says, on page 199, in A8.6, Initialization,
  28.  
  29.     Static and external variables which are not initilized are
  30.     guaranteed to start off as 0; automatic and register variables
  31.     which are not initialized are guranteed to start off as
  32.     garbage.
  33.  
  34. K&R 2 says, on page 219, A8.7, Initialization,
  35.  
  36.     A static object not explicitly initialized is initialized as
  37.     if it (or its members) were assigned the constant 0.  The
  38.     initial value of an automatic object not explicitly
  39.     initialized is undefined.
  40.  
  41. I need more convincing than your word.  Chapter and verse (plus
  42. quotations as suitable) is enough.
  43.  
  44. >The fact that some systems waste time doing so is no reason rely on it
  45. >as a feature.  This was already debated and tossed out as something to
  46. >rely on.
  47.  
  48. It has been a feature of C since the early 1970's (according to my
  49. knowledge it was there way before K&R 1 was published in 1978).  
  50.  
  51. --
  52. Lars.Wirzenius@helsinki.fi  (finger wirzeniu@klaava.helsinki.fi)
  53.    MS-DOS, you can't live with it, you can live without it.
  54.