This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


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

Re: [PATCH] Some compiler warnings removed


Eli Zaretskii wrote:
> 
> Here's my share of shutting up "gcc -Wall -W".  Is "foo = foo;" an
> okay solution for unused argument foo?
> 
> These diffs are against Feb 17 snapshot.  I hope they are still
> relevant and apply cleanly.
> 

> --- 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.

Also, I'd suggest configuring with:

	CFLAGS=-g .../configure --enable-build-warnings=-Wunused

so that you don't have to chase down too many warning in a single hit. 
That in turn constrains the patch to a specific type of change and makes
it very easy for people to approve.

>  {
> -  /* On AIX and i386 GNU/Linux, floating point values are returned in
> -     floating point registers.  */
> -#if defined(I386_AIX_TARGET) || defined(I386_GNULINUX_TARGET)
> +  /* On AIX, i386 GNU/Linux and DJGPP, floating point values are
> +     returned in floating point registers.  */
> +#if defined(I386_AIX_TARGET) || defined(I386_GNULINUX_TARGET) || defined(I386_DJGPP_TARGET)
>    if (TYPE_CODE_FLT == TYPE_CODE (type))
>      {
>        double d;
> @@ -720,7 +720,7 @@ i386_extract_return_value (type, regbuf,
>        store_floating (valbuf, TYPE_LENGTH (type), d);
>      }
>    else
> -#endif /* I386_AIX_TARGET || I386_GNULINUX_TARGET*/
> +#endif /* I386_AIX_TARGET || I386_GNULINUX_TARGET || I386_DJGPP_TARGET */

This one looks more like an actual code change?

	enjoy,
		Andrew

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