problem with fputc and fputs prototypes

Herman ten Brugge
Mon Dec 11 08:46:00 GMT 2000


I compiled the stdio library and had some strange warnings for fputc and
fputs. The following simple program shows the problem on i386, sparc and  c4x.

typedef struct { int fd; } FILE;

extern int fputc(int c, FILE *fp);
extern int fputs(const char *ptr, FILE *fp);

int fputc(int c, FILE *_fp) { return 0; }
int fputs(const char *ptr, FILE *fp) { return 0; }

Compiled with '-Wmissing-prototypes' the result is:

bug.c:6: warning: no previous prototype for `fputc'
bug.c:7: warning: no previous prototype for `fputs'

When I compile with '-fno-builtin -Wmissing-prototypes' the problem goes
I asume there is a problem with the builtin function fputc and fputs.
The functions are declared as 'int_ftype_any' in c-common.c. The comment
above this declaration suggests that this should work?


More information about the Gcc-bugs mailing list