home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.sun.misc
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!hellgate.utah.edu!csn!stortek!k2!alec
- From: alec@stortek.com (Alec Sharp - x2955)
- Subject: Sun's ANSI C
- Message-ID: <1992Dec30.164547.24172@stortek.com>
- Sender: usenet@stortek.com
- Nntp-Posting-Host: k2.stortek.com
- Reply-To: alec@stortek.com
- Organization: Storage Technology Corp
- Date: Wed, 30 Dec 1992 16:45:47 GMT
- Lines: 96
-
- We've been using the standard Sun C compiler on SunOS 4.1.x, and have just bought
- a copy of the ANSI compiler so that we can investigate moving to ANSI C. I tried
- compiling and linting some programs and noticed a problem with the function
- prototypes, some of which don't seem to conform to ANSI (I've included some examples
- below, with Sun's version first, then what I read as the ANSI standard).
-
- Has anyone else noticed this? If so, what did you do? If what I see is
- really what Sun produces, I'm rather disappointed with their quality control.
-
- -------------------------------------------------------
-
- From <string.h>
-
- extern char * memchr(const char *, int, int);
- extern void * memchr(const void *, int, size_t);
- ^^^^ ^^^^ ^^^^^^
-
- extern int memcmp(const char *, const char *, int);
- extern int memcmp(const void *, const void *, size_t);
- ^^^^ ^^^^ ^^^^^^
-
- extern char * memcpy(char *, const char *, int);
- extern void * memcpy(void *, const void *, size_t);
- ^^^^ ^^^^ ^^^^ ^^^^^^
-
- extern char * memset(char *, int, int);
- extern void * memset(void *, int, size_t);
- ^^^^ ^^^^ ^^^^^^
-
-
- From <stdlib.h>
-
- extern int abort(void);
- extern void abort(void);
- ^^^^
-
- extern char * calloc(size_t, size_t);
- extern void * calloc(size_t, size_t);
- ^^^^
-
- extern char * malloc(size_t);
- extern void * malloc(size_t);
- ^^^^
-
- extern char * realloc(void *, size_t);
- extern void * realloc(void *, size_t);
- ^^^^
-
- extern int free(void *);
- extern void free(void *);
- ^^^^
-
- extern int qsort(void *, size_t, size_t,
- int (*)(const void *, const void *));
- extern void qsort(const void *, size_t, size_t,
- int (*)(const void *, const void *));
- ^^^^ ^^^^^
-
-
- From <stdio.h>
-
- extern int clearerr(FILE *);
- extern void clearerr(FILE *);
- ^^^^
-
- extern int rewind(FILE *);
- extern void rewind(FILE *);
- ^^^^
-
- extern char *sprintf(char *, const char *, ...);
- extern int *sprintf(char *, const char *, ...);
- ^^^
-
- extern int fputc(char, FILE *);
- extern int fputc(int, FILE *);
- ^^^
-
- extern int vprintf(const char *, void *);
- extern int vprintf(const char *, va_list);
- ^^^^^^^
-
- extern int vfprintf(FILE *, const char *, void *);
- extern int vfprintf(FILE *, const char *, va_list);
- ^^^^^^^
-
- extern char *vsprintf(char *, const char *, void *);
- extern int *vsprintf(char *, const char *, va_list);
- ^^^ ^^^^^^^
-
- ---
-
- Alec_Sharp@stortek.com Storage Tek, 2270 S. 88th Street
- (303)-673-2955 Louisville, CO 80028-4286
- "The real problem is not whether machines think, but whether men do."
- Burrhus Skinner, 1969
-
-