This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

Re: RFC: Use -Wall -Wextra


On Sat, Dec 30, 2006 at 05:32:26PM +0200, Eli Zaretskii wrote:
> > I think neither of us is actually talking about -Walways-true.
> 
> Maybe.  I was talking about this one (happens with yesterday's
> snapshot):
> 
>     gcc -c -DHAVE_CONFIG_H    -I. -I.././readline -DRL_LIBRARY_VERSION='"5.1"' -g -O2 bind.c
>     bind.c: In function 'rl_function_of_keyseq':
>     bind.c:682: warning: comparison is always true due to limited range of data type
>     rm -f display.o
>     gcc -c -DHAVE_CONFIG_H    -I. -I.././readline -DRL_LIBRARY_VERSION='"5.1"' -g -O2 display.c
>     display.c: In function 'rl_character_len':
>     display.c:1844: warning: comparison is always true due to limited range of data type
> 
> It looks like this happens even without -Wall.  What a screwup!

OK, that's a whole different one - and yes, it's unconditional.  I
meant this one:

warning: comparison of unsigned expression >= 0 is always true

That's controlled by -Wextra directly.

Anyway, let's go with -Wall; that's still an improvement over the
present state and fixes the annoying -Wuninitialized warnings.  I'll
commit my saved up warning fixes, and then post a patch to do this.

> > Thanks.  That comes from the default definition of a macro which no
> > longer has any non-default definitions; we may as well garbage collect
> > it.  I don't know why I didn't get the warning; I can provoke it for
> > a small testcase.
> > 
> > I'll remove the macro, since that's an unrelated cleanup.
> 
> I'll wait for the patch, thanks.

Done now, in a separate message.

-- 
Daniel Jacobowitz
CodeSourcery


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