home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / atari / st / 11929 < prev    next >
Encoding:
Text File  |  1992-07-31  |  1.5 KB  |  37 lines

  1. Newsgroups: comp.sys.atari.st
  2. Path: sparky!uunet!mnemosyne.cs.du.edu!nyx!ilepore
  3. From: ilepore@nyx.cs.du.edu (Ian Lepore)
  4. Subject: Re: Bug in Pure-C
  5. Message-ID: <1992Jul31.191839.5999@mnemosyne.cs.du.edu>
  6. X-Disclaimer: Nyx is a public access Unix system run by the University
  7.     of Denver for the Denver community.  The University has neither
  8.     control over nor responsibility for the opinions of users.
  9. Sender: usenet@mnemosyne.cs.du.edu (netnews admin account)
  10. Organization: Nyx, Public Access Unix at U. of Denver Math/CS dept.
  11. References: <1932@dutiws.tudelft.nl> <DSTAILEY.92Jul30220937@leidecker.gsfc.nasa.gov>
  12. Date: Fri, 31 Jul 92 19:18:39 GMT
  13. Lines: 22
  14.  
  15.  
  16. >Static variables are declared inside functions.  Variables declared outside
  17. >of functions are global.  I'm not sure what the compiler is making of your
  18. >code, but I do know of one use of the "static" keyword outside of functions,
  19. >and that is in function declarations.  In this case, "static" means private,
  20. >i.e. not accessable to any code outside of the source module in which the
  21. >function is defined.
  22.  
  23.     
  24.  Static variables appear either inside or outside of functions.  When they
  25. appear outside functions, they work just as you describe for static functions:
  26. they are private to that source module.  (Er, to be picky, they're private
  27. to the current translation unit.)
  28.  
  29.  The original posting seems to describe a genuine compiler bug; it isn't
  30. a matter of usage error in the way the static variables are declared.
  31.  
  32.  
  33. --
  34. - Ian
  35. (void *) where prohibited by law
  36.  
  37.