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

Hendrik Leppkes h.leppkes at gmail.com
Thu Feb 4 17:08:11 CET 2016


On Thu, Feb 4, 2016 at 5:04 PM,  <ffmpeg-dev at c-14.de> wrote:
> On 16-02-04 at 15:48, Rostislav Pehlivanov wrote:
> [..]
>> 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.
> Just being pedantic, but -Wdeclaration-after-statement does not warn on
> any of those, see attached test file which compiles without errors with
> -Wall -Wpedantic -Werror -Wdeclaration-after-statement (at least on
> modern clang and gcc). No comment on the actual change.
>

The loop variable itself is the only that in the strictest sense would
count in that rule, although most compilers that enforce this rule
don't complain about it.
Variables can always be at the beginning of new blocks, ie. the first
line inside a loop body or after a if condition was never a problem.

- Hendrik


More information about the ffmpeg-devel mailing list