[FFmpeg-devel] [PATCH][RFC] -std=c99
Tue Aug 12 21:56:12 CEST 2008
Michael Niedermayer <michaelni at gmx.at> writes:
> the patch below adds -std=c99 to the cflags when supported.
> The advanatges this has is that the compiler uses C99 semantics,
> that several non C99 features and declarations become disabled by default
> and thus cannot so easily be used mistakely.
> Compilation and regression tests pass for me.
> -fasm is needed for
> -D_BSD_SOURCE is needed for
> -D_POSIX_C_SOURCE is needed for:
> -D_POSIX_C_SOURCE=2 is needed for:
> The defines are likely needed for more than what i have listed above,
> these where just amongth the first that showed up without the specfic option
Something like this has been on my low-priority TODO list (i.e. things
that I'd like to do, but probably never will) for some time.
_POSIX_C_SOURCE and _XOPEN_SOURCE are standard feature selection
macros, so using those is preferred over the glibc-specific ones.
Setting _BSD_SOURCE is slightly dangerous, since it makes glibc
replace a few standard functions with BSD-compatible functions of the
Most (all?) of the above-mentioned functions are POSIX standard, so
there should be no need for _BSD_SOURCE. If anything does require
this, we should look for a POSIX alternative.
mans at mansr.com
More information about the ffmpeg-devel