home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / sun / misc / 6065 < prev    next >
Encoding:
Text File  |  1992-12-30  |  3.2 KB  |  109 lines

  1. Newsgroups: comp.sys.sun.misc
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!hellgate.utah.edu!csn!stortek!k2!alec
  3. From: alec@stortek.com (Alec Sharp - x2955)
  4. Subject: Sun's ANSI C
  5. Message-ID: <1992Dec30.164547.24172@stortek.com>
  6. Sender: usenet@stortek.com
  7. Nntp-Posting-Host: k2.stortek.com
  8. Reply-To: alec@stortek.com
  9. Organization: Storage Technology Corp
  10. Date: Wed, 30 Dec 1992 16:45:47 GMT
  11. Lines: 96
  12.  
  13. We've been using the standard Sun C compiler on SunOS 4.1.x, and have just bought
  14. a copy of the ANSI compiler so that we can investigate moving to ANSI C. I tried
  15. compiling and linting some programs and noticed a problem with the function 
  16. prototypes, some of which don't seem to conform to ANSI (I've included some examples
  17. below, with Sun's version first, then what I read as the ANSI standard). 
  18.  
  19. Has anyone else noticed this? If so, what did you do?  If what I see is
  20. really what Sun produces, I'm rather disappointed with their quality control.
  21.  
  22. -------------------------------------------------------
  23.  
  24. From <string.h>
  25.  
  26. extern char *    memchr(const char *, int, int);
  27. extern void *    memchr(const void *, int, size_t);
  28.        ^^^^                  ^^^^         ^^^^^^
  29.  
  30. extern int     memcmp(const char *, const char *, int);
  31. extern int     memcmp(const void *, const void *, size_t);
  32.                              ^^^^          ^^^^    ^^^^^^
  33.  
  34. extern char *    memcpy(char *, const char *, int);
  35. extern void *    memcpy(void *, const void *, size_t);
  36.        ^^^^            ^^^^          ^^^^    ^^^^^^
  37.  
  38. extern char *    memset(char *, int, int);
  39. extern void *    memset(void *, int, size_t);
  40.        ^^^^            ^^^^         ^^^^^^
  41.  
  42.  
  43. From <stdlib.h>
  44.  
  45. extern int    abort(void);
  46. extern void    abort(void);
  47.        ^^^^
  48.  
  49. extern char *    calloc(size_t, size_t);
  50. extern void *    calloc(size_t, size_t);
  51.        ^^^^
  52.  
  53. extern char *    malloc(size_t);
  54. extern void *    malloc(size_t);
  55.        ^^^^
  56.  
  57. extern char *    realloc(void *, size_t);
  58. extern void *    realloc(void *, size_t);
  59.        ^^^^
  60.  
  61. extern int     free(void *);
  62. extern void     free(void *);
  63.        ^^^^
  64.  
  65. extern int    qsort(void *, size_t, size_t,
  66.             int (*)(const void *, const void *));
  67. extern void    qsort(const void *, size_t, size_t,
  68.             int (*)(const void *, const void *));
  69.        ^^^^           ^^^^^
  70.  
  71.  
  72. From <stdio.h>
  73.  
  74. extern int    clearerr(FILE *);
  75. extern void    clearerr(FILE *);
  76.        ^^^^
  77.  
  78. extern int      rewind(FILE *);
  79. extern void     rewind(FILE *);
  80.        ^^^^
  81.  
  82. extern char     *sprintf(char *, const char *, ...);
  83. extern int      *sprintf(char *, const char *, ...);
  84.        ^^^
  85.  
  86. extern int      fputc(char, FILE *);
  87. extern int      fputc(int, FILE *);
  88.                       ^^^
  89.  
  90. extern int    vprintf(const char *, void *);
  91. extern int    vprintf(const char *, va_list);
  92.                                       ^^^^^^^
  93.  
  94. extern int    vfprintf(FILE *, const char *, void *);
  95. extern int    vfprintf(FILE *, const char *, va_list);
  96.                                                ^^^^^^^
  97.  
  98. extern char    *vsprintf(char *, const char *, void *);
  99. extern int    *vsprintf(char *, const char *, va_list);
  100.        ^^^                                      ^^^^^^^
  101.  
  102. ---
  103.         
  104. Alec_Sharp@stortek.com        Storage Tek, 2270 S. 88th Street
  105. (303)-673-2955            Louisville, CO 80028-4286
  106. "The real problem is not whether machines think, but whether men do."
  107. Burrhus Skinner, 1969
  108.  
  109.