This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c/1097: current gcc misbehaves with fputc & fputs prototypes



>Number:         1097
>Category:       c
>Synopsis:       current gcc misbehaves with fputc & fputs prototypes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 19 14:36:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     cgd@sibyte.com (Chris Demetriou)
>Release:        gcc version 2.97 20001219 (experimental)
>Organization:
>Environment:
gcc version as above, accessed via web interface at
http://www.codesourcery.com/gcc-compile.shtml
>Description:
This problem was initially reported in:
http://gcc.gnu.org/ml/gcc-bugs/2000-12/msg00261.html
by Herman ten Brugge.  I ran into the problem myself
and searched the list, found his report of it, and
verified that it was a problem in the latest sources
(vintage mentioned above).

Below is the test case from his message to the list:

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; }
>How-To-Repeat:
use example above, compile with -Wmissing-prototypes.

it fails with warnings like:
/tmp/@20496.7.c:6: warning: no previous prototype for `fputc'
/tmp/@20496.7.c:7: warning: no previous prototype for `fputs'

if compiled with -fno-builtin, things work properly.
>Fix:
Unknown.  Workaround is to use -fno-builtin.
>Release-Note:
>Audit-Trail:
>Unformatted:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]