[MPlayer-dev-eng] -Wall

D Richard Felker III dalias at aerifal.cx
Sat Jun 5 02:50:22 CEST 2004


On Sat, Jun 05, 2004 at 01:27:27AM +0100, James Courtier-Dutton wrote:
> D Richard Felker III wrote:
> >On Fri, Jun 04, 2004 at 03:35:05PM +0100, J. Grant wrote:
> >
> >>>Not entirely opposed, but I disagree. It prints so much useless spam
> >>>that it's hard to see real bugs.
> >>
> >>The "useless spam" is just a confused compiler, all compilers do this.
> >>If it's confused, IMO we should clarify:  i.e. initialise variables to 0
> >>to stop "might be used uninitialized in this function", and correct
> >>casts etc, but we would never be aware of these unless some people
> >>locally add -Wall.
> >
> >
> >NO, ARE YOU FUCKING STUPID?!?! The whole reason the code was written
> >that was is that initializing to zero takes TIME!!!!! MPlayer is not
> >written to be slow crap like other players...
> >
> >Rich
> >
> 
> I have not looked at the code, but if it is just the compiler getting 
> confused, and that variable is always properly used, then don't change 
> the code. People are cleverer than compilers, and performance is important.
> 
> I agree with Rich on this point.

Just for the record, the essence of it is:

if (condition) {
  store a value in the variable
}
... other code ...
if (same_condition_as_before) {
  use the value of the variable
}

The compiler can't tell that the same conditional for initializing the
variable also applies to using it. Perhaps this would be possible with
some clever use of const keywords, but I doubt it even then. Compilers
just aren't very smart...

Rich




More information about the MPlayer-dev-eng mailing list