home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / programm / 2408 < prev    next >
Encoding:
Text File  |  1992-08-20  |  1.7 KB  |  39 lines

  1. Newsgroups: comp.programming
  2. Path: sparky!uunet!mcsun!Germany.EU.net!news.netmbx.de!zrz.tu-berlin.de!mailgzrz.tu-berlin.de!nickel
  3. From: nickel@cs.tu-berlin.de (Juergen Nickelsen)
  4. Subject: ANSI C, was Re: Teaching the basics
  5. In-Reply-To: mhcoffin@tolstoy.uwaterloo.ca's message of Thu, 20 Aug 1992 21:25:07 GMT
  6. Message-ID: <NICKEL.92Aug21010722@desaster.cs.tu-berlin.de>
  7. Lines: 22
  8. Sender: news@mailgzrz.tu-berlin.de (News Manager)
  9. Nntp-Posting-Host: desaster.cs.tu-berlin.de
  10. Reply-To: nickel@cs.tu-berlin.de
  11. Organization: STONE Project, Technical University of Berlin, Germany
  12. References: <Bt6DGq.HuB@metropolis.com> <12635@anderson>
  13.     <ratner.714247759@ficus.cs.ucla.edu> <13226@bnr-rsc.UUCP>
  14.     <MHCOFFIN.92Aug20162507@tolstoy.uwaterloo.ca>
  15. Date: Thu, 20 Aug 1992 23:07:25 GMT
  16.  
  17. In article <MHCOFFIN.92Aug20162507@tolstoy.uwaterloo.ca>
  18. mhcoffin@tolstoy.uwaterloo.ca (Michael Coffin) writes:
  19.  
  20. > It is true that if you use a certain amount of discipline and make
  21. > sure that the same prototype appears in both places---by putting it in
  22. > an include file---the compiler will detect the error.  The problem is,
  23. > there isn't any enforcement of this policy.
  24.  
  25. This is indeed a weakness of the standard, but at least gcc can be
  26. told to issue a warning when a function call without a previous
  27. prototype is encountered. From the manual:
  28.  
  29.     `-Wmissing-prototypes'
  30.      Warn if a global function is defined without a previous prototype
  31.      declaration.  This warning is issued even if the definition itself
  32.      provides a prototype.  The aim is to detect global functions that
  33.      fail to be declared in header files.
  34.  
  35. But using this is a major pain on a system without ANSI Header files.
  36.  
  37. --
  38. Juergen Nickelsen
  39.