On Wed, Feb 05, 2014 at 08:58:52PM +0100, Stephan Gatzka wrote:
> First of all, the linuxptp project is one of my favorite open source 
> projects because one can see that people really care about the code. For 
> instance, the code compiles very cleanly.
> 
> To keep the very good level I would like to introduce some more stricter 
> warnings in the makefile.

You can always add your own preferences to your build, for example
like this.

    export EXTRA_CFLAGS="-O2 -Werror"

> That's my suggestion:
> -Wstrict-overflow=5 (no warning on the existing code basis, that's 
> great!)

What does this do?

> -Wpointer-arith (no warnings on the existing code basis)
> -Wformat=2 (no warnings on the existing code basis)

And this?

> -Wcast-align (no warnings on the existing code basis)
> -Wmissing-declarations (very few and easy to fix warnings)

Please submit a patch to fix these.

> -Wextra (gives some warnings about sing/unsigned comparisons)

This one I don't like. Isn't it a collection of individual flags?

The bogus signed/unsigned warnings are particularly annoying.

> and probably
> -Wwrite-strings
> 
> The latter is debatable. In gives string constants the type const 
> char[], so it can give us warnings if someone tries to write into such 
> constants. But this stuff requires to make all functions const correct, 
> which is some annoying work to do. I would volunteer for this, but only 
> if we agree that we would like to have it.
> 
> So what's your opinion on that?

I am usually happy with -Wall, and I think -Wextra makes unneeded
noise. I'll try out the other specific suggested options individually,
since I am unfamiliar with them.

I encourage you to build will all the options you want, and then
submit patches for the "bugs" found.

Thanks,
Richard



------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to