[FFmpeg-devel] FFmpeg source code is no longer C99 because of GNUism called case ranges

Måns Rullgård mans
Mon Jun 25 10:09:59 CEST 2007

Roman Shaposhnik <rvs at sun.com> writes:

> Guys,
> I've always been very happy about the fact that ffmpeg's
> source code has been more or less C99. Well it seems that
> it is no longer the case and I just wanted to get your 
> opinion on what should be done about it. The major GNUism 
> that sneaked through is 'case ranges'. Things like:
>    switch (i) {
>       case 1 ... 100:
>               break;
>    }
> We have them in:
>      libavcodec/rv10.c:[564,570]
>      libavformat/mp3.c:237
>      libavformat/raw.c:378
> and out of these 3 libavformat/mp3.c is the only one which is trivial to
> fix.
> My question, of course, is -- would it be acceptable to make code C99
> compliant again at an expense of making it slightly less regular?

The main code should be C99 compliant, extensions only allowed under
appropriate #ifdefs and always with a proper fallback (think asm()).

Patches, clean of course, to fix issues like the ones you mention are
always welcome.

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list