home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / gnu / gcc / bug / 3135 < prev    next >
Encoding:
Text File  |  1993-01-08  |  1.1 KB  |  40 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!clsi.UUCP!mitch
  3. From: mitch@clsi.UUCP (Mitchell Perilstein)
  4. Subject: Mismatched function storage class not reported--OK?
  5. Message-ID: <9301071707.AA13194@clsi.clsi.COM>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Thu, 7 Jan 1993 17:07:43 GMT
  10. Approved: bug-gcc@prep.ai.mit.edu
  11. Lines: 27
  12.  
  13. If this file
  14.  
  15.   static int foo();
  16.  
  17.   int foo() 
  18.   {
  19.     return 1;
  20.   }
  21.  
  22. is compiled -Wall -c, no warning is issued regarding mismatched storage
  23. class between the declaration and the definition.  The function is taken
  24. to be static, as shown by nm on the result (`t' indicates static symbol
  25. in SunOS nm):
  26.  
  27.   00000000 t _foo
  28.   00000000 t gcc2_compiled.
  29.  
  30. Taking foo as static is OK, since the first external declaration
  31. specifies static.  The Standard describes how the types must all match
  32. up, but what does it say about storage classes? Should a warning be
  33. issued? 
  34.  
  35. This is gcc 2.1 on Sun4 SunOS 4.1.2.
  36. ---
  37.  Mitchell N. Perilstein   CAD Language Systems, Inc.   410-992-5700 x225 
  38.  Member, League for Programming Freedom.  Mail lpf@uunet.uu.net for info.
  39.  
  40.