[FFmpeg-devel] [PATCH] RoQ encoder

Guillaume Poirier gpoirier
Sat May 5 10:08:25 CEST 2007


Hi,

On May 5, 2007, at 3:00 , Rich Felker wrote:

> On Sat, May 05, 2007 at 12:57:35AM +0100, Robert Swain wrote:
>> Out of personal interest and being a lesser experienced programmer,
>> I've always been lead to believe that 'goto' shouldn't be used unless
>> absolutely necessary. Grepping the FFmpeg source throws up far more
>> results than I expected so now I'm wondering - why have you suggested
>> the use of goto over something like a 'while' loop? If it's better to
>> use a goto in some cases, I'd like to know when and why. :)
>
> This is nonsensical dogma. Continue and break statements are exactly
> the same thing as goto. Use whatever control construct makes sense to
> the code you're writing. Inserting dummy loops so you can break just
> to "hide" your goto in a break statement is ridiculous. If you mean
> goto, say goto.
>
> FWIW, goto is extremely useful for error case handling can cleanup
> before error returns.

It's maybe useful for the programmer, but it confuses compilers so  
that some optimization passes can't be performed on a code with goto's.
Well, maybe not all compilers are like this, but i bet it confuses  
GCC, who's not the smartest compiler around...

Guillaume




More information about the ffmpeg-devel mailing list