This is the mail archive of the gcc-patches@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]

Re: misc warnings patch (installed)


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

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