[FFmpeg-devel] [PATCH] make sure initialization happens even after goto fires

Måns Rullgård mans
Thu Jul 17 18:57:04 CEST 2008


Erik Hovland wrote:
> The goto in ff_h264_find_frame_end() is inside an else clause. The
> initialization for v happens in the if clause elsewhere. That means that
> it is possible for the goto to fire without the initialization of v
> happening. Normally this isn't a problem. But gcc recognizes this and
> throws an internal parse warning. It then has to go through a special
> code branch to take care of this. If the initialization of v always
> happens before either clause this does not happen. The attached patch
> does just that.

The gcc internals are irrelevant.  Only two things matter: 1) whether
it is valid C code, and 2) whether gcc issues a warning.  As far as
I can tell, it is valid C.  The question is thus, does it trigger a
warning with gcc?

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list