home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / sgi / 13014 < prev    next >
Encoding:
Text File  |  1992-08-29  |  2.2 KB  |  64 lines

  1. Path: sparky!uunet!ogicse!uwm.edu!cs.utexas.edu!ut-emx!shrike!flash
  2. From: flash@austin.lockheed.com (James W. Melton)
  3. Newsgroups: comp.sys.sgi
  4. Subject: Re: Missing Prototypes - Solution!
  5. Keywords: prototypes, irix
  6. Message-ID: <1173@shrike.com>
  7. Date: 28 Aug 92 05:50:04 GMT
  8. Article-I.D.: shrike.1173
  9. References: <3419@ra.nrl.navy.mil>
  10. Organization: "Lockheed Austin Division, 6800 Burleson Rd, Austin, TX 78744
  11. Lines: 51
  12.  
  13. In article <3419@ra.nrl.navy.mil> russo@rudedog.nrl.navy.mil (Kevin Russo) writes:
  14. >
  15. >Since we're all ANSI-fying our code these days, several people may
  16. >have run into the ol' missing prototype problem. It seems that the
  17. >prototype declarations for some system and library routines are not
  18. >anywhere to be found in the header files. (It's always the one you
  19. >want, too.)
  20. >
  21.  
  22. Of course, these are just the ones supplied with the OS; add on
  23. your third party functions (like Sybase)...
  24.  
  25. Which raises and interesting problem. We are also compiling all our
  26. code -fullwarn and attempting to resolve the warnings. So I entered
  27. from the man pages the prototypes for the Sybase functions we are
  28. using (an aside: Sybase said they included ANSI prototypes in
  29. 4.6.1, but we won't see them on SGI until 5.0 is released).
  30.  
  31. One function has a parameter which is declared BYTE *. From the
  32. Sybase header files,
  33.  
  34. typedef unsigned char BYTE;
  35.  
  36. Now, the SGI compiler treats characters as unsigned by default
  37. (according to the CC man page). Use the -signed flag to get signed
  38. characters. However, the following code fragment will not compile
  39. under IRIX 4.0.1
  40.  
  41. extern void foo (unsigned char *ptr);
  42.  
  43. void bar(void)
  44. {
  45.     char line[80];
  46.  
  47.     foo(line);
  48. }
  49.  
  50. If char's are unsigned by default, why is there a difference
  51. between and an unsigned char * and a char *? I called the TAC, and
  52. the guy there didn't think it was a problem, but he filed a bug
  53. report for me anyway. Just an irritation, but one that shouldn't
  54. have been. There are enough other *real* problems to fix in the
  55. code! :-)
  56.  
  57.  
  58.  
  59. -- 
  60. Jim Melton, novice guru
  61. email:      flash@austin.lockheed.com | "So far as we know, our
  62. voice mail: (512) 386-4486            |  computer has never had
  63. fax:        (512) 386-4223            |  an undetected error"
  64.