home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / sgi / 12773 < prev    next >
Encoding:
Internet Message Format  |  1992-08-21  |  2.0 KB

  1. Path: sparky!uunet!cs.utexas.edu!sdd.hp.com!swrinde!mips!darwin.sura.net!dtix!mimsy!ra!russo
  2. From: russo@rudedog.nrl.navy.mil (Kevin Russo)
  3. Newsgroups: comp.sys.sgi
  4. Subject: Missing Prototypes - Solution!
  5. Keywords: prototypes, irix
  6. Message-ID: <3419@ra.nrl.navy.mil>
  7. Date: 22 Aug 92 02:52:12 GMT
  8. Sender: usenet@ra.nrl.navy.mil
  9. Organization: Naval Research Lab, Washington, DC
  10. Lines: 44
  11.  
  12.  
  13. Since we're all ANSI-fying our code these days, several people may
  14. have run into the ol' missing prototype problem. It seems that the
  15. prototype declarations for some system and library routines are not
  16. anywhere to be found in the header files. (It's always the one you
  17. want, too.)
  18.  
  19. I began investigating these inconsistencies between the man pages
  20. and header files (IRIX 4.0.4) a few weeks ago.  I found that the
  21. functions fell into 5 states of documentation.
  22.  
  23. Functions whose man pages...
  24.  o were in sync with the #include files. These are what we want!
  25.  
  26.  o listed no #include files *and* the function was not prototyped
  27.    in any header file.
  28.  
  29.  o listed no #include files but the function was prototyped in
  30.    *some* header file.
  31.  
  32.  o listed #include files(s) but the function was prototyped somewhere else.
  33.  
  34.  o listed #include files(s) but the function was not prototyped anywhere.
  35.  
  36. Combinations! Permutations!
  37. And of course there were some functions declared in headers but
  38. had no man page. I'm not interested in these undocumented guys.
  39.  
  40. A few shell and awk scripts later, and there were ~280 functions whose
  41. man pages didn't jive with the /usr/include tree.
  42.  
  43. In fairness to SGI, the IRIX man pages come from many sources outside
  44. of SGI, eg AT&T, Sun, BSD, Mips, X11, and a good many of the ones with
  45. problems were from those places. (I didn't attempt to check the X11 tree.)
  46.  
  47. I put all the missing prototypes and extern variables in one jumbo
  48. header file. Since the file is 530 lines, I'm reluctant to post it,
  49. but I'll send it to anyone who wants it. Or I'll post it if there's a
  50. big demand.  Happy Hacking.
  51.  
  52.  
  53. Kevin Russo
  54. russo@orion.nrl.navy.mil
  55. SFA, Inc. / US Naval Research Lab, Washington, DC
  56.