[FFmpeg-cvslog] r11690 - trunk/libavcodec/h263.c
Thu Jan 31 06:00:37 CET 2008
On Wed, Jan 30, 2008 at 08:31:09PM -0800, Mike Melanson wrote:
> >>>> - int dc_pred_dir= dc_pred_dir;
> >>>> + int dc_pred_dir= dc_pred_dir; //weird init to prevent uninitalized warning
> >>> This code is INVALID C and needs to be removed. A program containing
> >>> this line has undefined behavior. Writing invalid C is not a
> >>> legitimate way to silence gcc's bullshit warnings.
> >> Could we compromise using a global variable?
> > Huh? How would that help? It would make the code potentially slower
> > AND would make the whole library non-reentrant!!!
> Ah. I knew there was a good reason.
> Maybe thread-local storage? :)
Umm, the whole point was about valid C. There is no such thing in the
C language and even if there were, its performance is MUCH worse than
normal variables. Also it does not solve the reentrancy problem; for
example, using a decoder from a signal handler would not be safe.
More information about the ffmpeg-cvslog