Thread View: gnu.gcc.bug
1 messages
1 total messages
Started by Vivek Singhal
Fri, 20 Nov 1992 04:04
GCC 2.3.1 on Sparc -- conflicting types
Author: Vivek Singhal
Date: Fri, 20 Nov 1992 04:04
Date: Fri, 20 Nov 1992 04:04
38 lines
1962 bytes
1962 bytes
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'
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads