This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: [PATCH] Some compiler warnings removed
Mark Kettenis wrote:
>
> Date: Thu, 24 Feb 2000 06:07:57 -0500 (EST)
> From: Eli Zaretskii <eliz@delorie.com>
>
> > From: Andrew Cagney <ac131313@cygnus.com>
> >
> > > --- gdb/blockframe.c~0 Wed Dec 22 21:45:02 1999
> > > +++ gdb/blockframe.c Wed Feb 23 16:51:44 2000
> > > @@ -70,6 +70,7 @@ nonnull_frame_chain_valid (chain, thisfr
> > > CORE_ADDR chain;
> > > struct frame_info *thisframe;
> > > {
> > > + thisframe = thisframe;
> > > return ((chain) != 0);
> > > }
> > >
> >
> > FWIW,
> >
> > The way GCC handles this is by appending ATTRIBUTE_UNUSED to the
> > parameter declaratons. I see no reason for doing it differently.
>
> I'm not sure I follow. I know about __attribute__((unused)), but I
> thought I couldn't use GCC-specific extensions, except in places which
> will never be compiled by anything but GCC (like go32-nat.c). If
> there is a portable way of doing this that I missed, please tell me
> where to look.
>
> Take a look at include/ansidecl.h. People who are not using GCC will
> have to learn to live with the warnings :-).
Just an asside. I personally wish that a few of the GCC -W* flags were
tweeked so that they better differentiated between various warnings.
Unused locals vs unused parameters is one example. The random warnings
from -W is another.
Adding ATTRIBUTE_UNUSED is just a compromise.
Andrew