[ccan] Should we start using -Wextra in CCAN?

Rusty Russell rusty at rustcorp.com.au
Mon May 18 00:09:32 EST 2009


On Fri, 15 May 2009 05:21:51 pm Joseph Adams wrote:
> Building with -Wall -Wextra (a.k.a. -Wall -W) adds extra warnings like
> "Comparison between signed and unsigned" and "Unused variable foo"
> that are not present in -Wall by itself.  This can be a major nuisance
> when trying to use a CCAN module in a project that uses -Wextra.

We should definitely ccanlint score it, but -Werr and -Wextra is probably too 
much.

Just looking at this patch made my eyes hurt: sure, it could be cleverer in a 
few places, but the first few dozen hunks revealed none which add clarity or 
otherwise help the code  (which is why these warnings aren't in -Wall, after 
all).

But a useful exercise, nonetheless!

> I also
> changed the template for run.c so it would read "int main(void)"
> instead of "int main(int argc, char *argv[])", as argc and argv are
> unused.

Wow, I didn't realize that was legal, but the standard says you're right.

Please send that cleanup separately.

Thanks!
Rusty.



More information about the ccan mailing list