home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / linux / 22076 < prev    next >
Encoding:
Text File  |  1992-12-29  |  1.3 KB  |  37 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!howland.reston.ans.net!paladin.american.edu!darwin.sura.net!cs.ucf.edu!mcampbel
  3. From: mcampbel@cs.ucf.edu (Mike Campbell )
  4. Subject: Re: IMPORTANT [BUG in 0.99] Re: [ANNOUNCE]: linux version 0.99
  5. Message-ID: <mcampbel.725666039@eola.cs.ucf.edu>
  6. Sender: news@cs.ucf.edu (News system)
  7. Organization: University of Central Florida
  8. References: <1992Dec19.222324.22106@klaava.Helsinki.FI> <1hpsasINN6e@meaddata.meaddata.com> <20502@ksr.com>
  9. Date: Tue, 29 Dec 1992 21:53:59 GMT
  10. Lines: 25
  11.  
  12. zdenek@ksr.com (Zdenek Radouch) writes:
  13.  
  14. >Stephen Williams writes:
  15.  
  16. >>Statics are either explicitly initialized or they are not.
  17. >>If they are not, their contents are UNDEFINED until set.
  18. >>This is per ANSI C.
  19. >>There is NO requirement of the compiler or system to zero
  20. >>un-initialized statics (or auto's).
  21.  
  22.  
  23. >I'll quote for you:
  24.  
  25. >"A static object not explicitly initialized is initialized as if it 
  26. >(or its members) were assigned the constant 0. The initial value of
  27. >an automatic object not explicitly initialized is undefined."
  28.  
  29.  
  30. You are correct - what would be the advantage of a static in a function?
  31.  
  32. If you NEEDED to initialize it, you would lose the value of the variable
  33. every time the function was called, nullifying the advantage statics have
  34. in functions, (namely holding a value out of visibility).
  35.  
  36.  
  37.