[MPlayer-dev-eng] [PATCH] More warnings

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Feb 7 07:54:46 CET 2011


On Mon, Feb 07, 2011 at 12:22:45AM +0200, Uoti Urpala wrote:
> On Sun, 2011-02-06 at 22:17 +0100, Reimar Döffinger wrote:
> > The few cases where they don't are easy enough to ignore.
> 
> This is not true either. One large and general class of counterexamples
> is code that passes values forward without itself modifying them (strchr
> in the standard C library is a canonical example).

And most people do not write a C library.
And strchr could have avoided the issue by returning the offset instead
of a pointer (though at a performance cost, so it is not always a good idea).
Also the lack of usefulness you claim is not convincing, e.g. in FFmpeg
quite a few codecs implementing the API incorrectly (modifying the input
buffer) slipped by because of not using const or casting it away "accidentally".
And on several programs I used -Wwrite-strings the first time it ended up
showing stuff like string constant pointers being freed (yes, obviously
valgrind never ran over that code either).


More information about the MPlayer-dev-eng mailing list