problem with fputc and fputs prototypes

Herman ten Brugge Haj.Ten.Brugge@net.HCC.nl
Mon Dec 11 08:46:00 GMT 2000


Hello,

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:

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

When I compile with '-fno-builtin -Wmissing-prototypes' the problem goes
away.
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?

	Herman.


More information about the Gcc-bugs mailing list