[RFA] fix child_xfer_memory in hppah-nat.c

Eli Zaretskii eliz@delorie.com
Tue Feb 6 08:37:00 GMT 2001


> Date: Mon, 5 Feb 2001 13:18:14 -0500
> From: Christopher Faylor <cgf@redhat.com>
> 
> Here are the lines from configure.in:
> 
>     # NOTE: Don't add -Wall or -Wunused, they both include
>     # -Wunused-parameter which reports bogus warnings.
> 
> The TODO has some words, too:
> 
>     Frequently requested but not approved requests.
> 
>     --
> 
>     Eliminate unused argument warnings using ATTRIBUTE_UNUSED.
> 
>     The benefits on this one are thought to be marginal - GDBs design
>     means that unused parameters are very common.  GCC 3.0 will also
>     include the option -Wno-unused-parameter which means that ``-Wall
>     -Wno-unused-parameters -Werror'' can be specified.
> 
> 
> >Several files in the CVS use ATTRIBUTE_UNUSED (not surprisingly, 
> >go32-nat.c is one of them ;-).  So I wonder what is the current say-so 
> >on this matter.
> 
> I specifically added some of these to win32-nat.c, too, not too long ago.
> I do remember the discussion now.  I can't say that I agree with it,
> but I remember it.
> 
> It looks like at least one discussion is here:
> 
> http://sources.redhat.com/ml/gdb/2000-q1/msg00826.html

Thanks for the pointers.

However, after reading those, I'm still unsure what, if anything,
should I do with ATTRIBUTE_UNUSED in files I'm responsible for.

The TODO snippet seems to say that ATTRIBUTE_UNUSED should be deleted,
and we should endure the warnings until GCC 3.0 conquers the face of
Earth.  The discussion you pointed to seems to say the same, albeit
differently: it tells that GCC options should be changed to avoid
triggering the warnings which require ATTRIBUTE_UNUSED.

I remember that I added ATTRIBUTE_UNUSED to stop those warnings from
popping up and obscuring the real warnings (such as the one about the
missing mem_attrib parameter in go32_xfer_memory that I fixed the
other day).  I also set up a special set of compiler switches (in
gdb/config/djgpp/djconfig.sh) to make sure these warnings don't
return.  But to remove ATTRIBUTE_UNUSED from the sources we need a
more safe assumption to bet on...

Andrew?


More information about the Gdb-patches mailing list