[Ffmpeg-devel] Compiler warnings

Alexander Strasser eclipse7
Thu Feb 2 03:08:26 CET 2006


M?ns Rullg?rd wrote:
> Michael Niedermayer <michaelni at gmx.at> writes:
> > On Wed, Feb 01, 2006 at 09:03:36AM +0000, Dieter wrote:
> >> >> It is good practice to keep harmless warnings away.  That way, the
> >> >> real ones are more easily noticed.
> >> 
> >> YES!
> >> 
> >> > The easy way to silence the rest of the warnings is to supply
> >> > the -Wno-pointer-sign option to gcc
> >> 
> >> Can you guarantee that every possible pointer-sign warning
> >> now and in the future will be harmless?  
> >
> > no, can you gurantee that every odd numbered line will be bug free? so 
> 
> Sure, make them blank.

  No, you miss the point: you can't guarantee that they are blank ;)
Else Micheal or anyone else could guarantee that all pointer sign
warnings in his code are no bugs.

> > why not print a warning for them? its not about that it might in some
> > very rare cases indicate a bug but if it does more often then the
> > remaning lines (i can show you cases where warining free lines where
> > buggy, can you show me one where a f([(signed)]p) case was buggy)
> > and MOST important are you checking the code to see if its buggy before
> > you add (signed)/(unsigned) casts or are you maybe just blindly 
> > suppressing the warnings without understanding the code
> > now tell me how THAT is better from suppressing the warnings with a
> > compiler switch ...
> 
> I can think of cases where a signed/unsigned difference could cause
> unexpected behavior, but these are rare.

  I think we can all agree that blindly silencing compiler warnings
is bad in any case. (It even kind of defeats their whole purpose.)

  Alex (beastd)





More information about the ffmpeg-devel mailing list