This is the mail archive of the insight@sourceware.cygnus.com mailing list for the Insight project.


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

Re: Warnings


Duane Ellis wrote:
> 
> Here at Franklin, we have an internal requirement that *ALL* code we write
> is compiles with no warnings or errors and with these options:
> 
>      -Wall -Wmissing-prototypes -Wstrict-prototypes
> 
> and in most cases, -Werror also.

For GDB, compiling with most warning flags enabled is a long term goal. 
Right now configuring/building using:

--enable-build-warnings="-Werror\
,$Wimplicit\
,-Wreturn-type\
,-Wcomment\
,-Wtrigraphs\
,-Wformat\
,-Wparentheses\
,-Wpointer-arith\
,-Woverloaded-virtual\
"

is known to build on a number of platforms. I believe people are
currently (slowly) chipping away at more of the unitialized and
prototype warnings.  If you've got patches (and an assgnment) then
patches are welcome.

BTW, the warning options enabled by -Wall were chosen according to a
somewhat arbitrary selection criteria.

[...]
> We have a standard way of getting rid of this here.
> 
> Add the following to "defs.h"
> 
> #define GDB_UNUSED_PARM( NAME )         (void)(NAME)
> 
> Then, in function in this example in utils.c" would look like this:
> 
> static void
> pagination_off_command (arg, from_tty)
>      char *arg;
>      int from_tty;
> {
>   GDB_UNUSED_PARAM( arg );
>   GDB_UNUSED_PARAM( from_tty );
>   pagination_enabled = 0;
> }
> ------------------------------------------------------------
> 
> Have you guys thought of adding these changes to Insight?

Not so far.  GDB's code is riddled with #ifdefs that make it difficult,
in general, to eliminate unused variable warnings (parameters or
locals).  What is used on one host/target is not on a second :-(.

As a personal opinion, I think a better way of getting rid of this
particular warning would be to modify GCC so that it differentiated
between local and parameter variables :-)

	enjoy,
		Andrew

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