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

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!viewlogic.COM!przemek
  3. From: przemek@viewlogic.COM (Przemek Skoskiewicz)
  4. Subject: Spurious warnings...
  5. Message-ID: <9301112152.AA06322@elvis>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Mon, 11 Jan 1993 21:52:21 GMT
  10. Approved: bug-gcc@prep.ai.mit.edu
  11. Lines: 39
  12.  
  13. Compiling the following code with -Wall option produces these warnings:
  14.  
  15. >gcc -Wall bar.c
  16. bar.c:5: warning: return-type defaults to `int'
  17. bar.c: In function `main':
  18. bar.c:10: warning: implicit declaration of function `_filbuf'   <----
  19. bar.c:11: warning: implicit declaration of function `fclose'    <----
  20. bar.c:12: warning: control reaches end of non-void function
  21.  
  22.  
  23. Why do I get the warnings for _filbuf and fclose given the fact that I've
  24. included the stdio.h header file (especially in view of the lack of a warning
  25. for fopen)?  I'm especially interested in _filbuf since it's cluttering the
  26. more important warnings generated by the -Wall option.
  27.  
  28.  
  29. #include    "stdio.h"
  30.  
  31. main()
  32. {
  33.     int     ch;
  34.     FILE   *fp;
  35.  
  36.     fp = fopen ("bar.c", "r");
  37.     ch = getc (fp);
  38.     fclose (fp);
  39. }
  40.  
  41.  
  42. System: SPARCstation IPX
  43. OS:     SunOS 4.1.3
  44. GCC:    2.2.2 and 2.3.2 and 2.3.3
  45.  
  46.  
  47. Viewlogic Systems, Inc.                         Przemek Skoskiewicz
  48. 293 Boston Post Road West
  49. Marlborough, MA 01752-4615, USA
  50. email: przemek@viewlogic.com
  51.  
  52.