[FFmpeg-devel] [PATCH] configure: remove the mixed declarations and code warning flag

Derek Buitenhuis derek.buitenhuis at gmail.com
Thu Feb 4 16:55:52 CET 2016


On 2/4/2016 3:48 PM, Rostislav Pehlivanov wrote:
> The only reason this existed was to allow for old compilers to not
> complain/compile the project's code. As far as I know, we no longer have
> support for such compilers hence this flag has become useless and we
> have no reason to continue dragging so much behind the current standard
> of the C language.

We do. Older MSVC (via c99conv), and I am sure others.

> Michael Niedermayer has already expressed interest in removing said flag:
> http://ffmpeg.org/pipermail/ffmpeg-devel/2016-January/187833.html

[...]

> This will essentially help bring the project to near 21st century age
> and finally allow for developers to save on line numbers by NOT having
> to define the variable around which a for loop needs to iterate (e.g.
> have for (int i = 0; i < N; i++) loops instead of having to define 'i'
> at the start of the function like a normal variable), as well as more of
> the syntactic sugar C99 permits.

I do mind for loops, but I consider, along with VLAs, mixed code and var
decls to be bad practice, myself. If you have a ton of variables declared
at the top of blocks, I argue you have other issues. I also believe mixing
code/var decls makes variable shadowing much easier. My 2 cents, for what
little it is worth.

- Derek


More information about the ffmpeg-devel mailing list