This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: misc warnings patch (installed)
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: misc warnings patch (installed)
- From: Zack Weinberg <zack at wolery dot cumb dot org>
- Date: Mon, 22 May 2000 12:10:53 -0700
- Cc: gcc-patches at gcc dot gnu dot org
- References: <200005210315.XAA09506@caip.rutgers.edu>
On Sat, May 20, 2000 at 11:15:42PM -0400, Kaveh R. Ghazi wrote:
> > From: Zack Weinberg <zack@wolery.cumb.org>
> >
> > Mostly adding prototypes, and more consts in gcc.c. The remaining
> > prototype warnings, not counting gen_call and friends, are:
> >
> > cp/errfn.c:42: warning: function declaration isn't a prototype
> > cp/error.c:29: warning: function declaration isn't a prototype
> > libgcc2.c:1297: warning: no previous prototype for `__builtin_saveregs'
> > libgcc2.c:1355: warning: function declaration isn't a prototype
> >
> > errfn.c and error.c are pulling dirty tricks with function pointers.
> > I'm not sure what's up with libgcc2.c.
>
> The libgcc2.c:1297 warning complains about __builtin_saveregs not
> being prototyped which is quite odd considering its explicitly done in
> libgcc2.h.
Indeed. Here's a cut down version of the file:
void *__builtin_saveregs (void);
void *
__builtin_saveregs (void)
{
abort ();
}
$ ./cc1 libgcc2.i -quiet -dumpbase libgcc2.c -g -g1 -O2 -W -Wall \
-Wno-long-long -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -fPIC -o libgcc2.s
libgcc2.i:4: warning: no previous prototype for `__builtin_saveregs'
$
I'm betting on some weirdness with builtin function prototypes; note
we don't get a complaint about implicit declaration of abort, either.
Only three architectures use __builtin_saveregs (i860, mips, sparc)
and it has to be written entirely in assembly language. Perhaps it
should be moved to a LIB2FUNCS .S file for those architectures.
zw