home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.gcc.bug
- Path: sparky!uunet!cis.ohio-state.edu!cs.utexas.edu!singhal
- From: singhal@cs.utexas.edu (Vivek Singhal)
- Subject: GCC 2.3.1 on Sparc -- conflicting types
- Message-ID: <9211201604.AA14005@twins.cs.utexas.edu>
- Sender: gnulists@ai.mit.edu
- Organization: GNUs Not Usenet
- Distribution: gnu
- Date: Fri, 20 Nov 1992 04:04:04 GMT
- Approved: bug-gcc@prep.ai.mit.edu
- Lines: 39
-
- Here's a bug I ran across when compiling glibc-1.05 on a Sparc running
- SunOS 4.1.2 (using GCC 2.3.1). GCC reports an extraneous error
- (conflicting types for `puts'); note that this error disappears when
- the declaration for `strlen' is removed.
-
- This error does not occur on other architectures that I've tried
- (DecStation 5000/20 running Ultrix 4.2a, HP 9000/300 running HP/UX
- 7.0, Sun 3/50 running SunOS 4.1.2).
-
- Vivek
-
- ----------------------------------------------------------------
- Vivek Singhal singhal@cs.utexas.edu Office: (512) 471-9711
- Univ of TX @ Austin, CS Dept, TAY 3.104C Home: (512) 385-1855
-
- % cat puts-bug.c
- typedef unsigned long int size_t;
- typedef struct stdio_file FILE;
- extern FILE *stdout;
- extern int putchar (int c);
- extern int fputs (const char *s, FILE * stream);
- extern int puts (const char *s);
- extern size_t strlen (const char *s);
-
- int
- puts (const char *s)
- {
- return (fputs (s, stdout) || putchar ('\n') == (-1) ? (-1) : 0);
- }
- % gcc -v -c puts-bug.c
- Reading specs from /p/lib/gcc-lib/sun4/2.3.1/specs
- gcc version 2.3.1
- /p/lib/gcc-lib/sun4/2.3.1/cpp -lang-c -v -undef -D__GNUC__=2 -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix puts-bug.c /usr/tmp/cca23212.i
- GNU CPP version 2.3.1 (sparc)
- /p/lib/gcc-lib/sun4/2.3.1/cc1 /usr/tmp/cca23212.i -quiet -dumpbase puts-bug.c -version -o /usr/tmp/cca23212.s
- GNU C version 2.3.1 (sparc) compiled by GNU C version 2.3.1.
- puts-bug.c:11: conflicting types for `puts'
- puts-bug.c:6: previous declaration of `puts'
-
-