Re: [igt-dev] [PATCH i-g-t 1/2] meson: Drop -Wdeclaration-after-statement.

Jani Nikula
2018-11-28T11:21:34Z

On Tue, 27 Nov 2018, Eric Anholt <eric@anholt.net> wrote:
> Being able to move declarations later is very useful in making clear,
> concise code.

I guess you primarily need this in patch 2/2 for declaring the loop
variable in the for statement. I like that, just not the general case of
declarations after statements. Anyway, I'll let others fight the holy
wars on this. ;)

BR,
Jani.

>
> Signed-off-by: Eric Anholt <eric@anholt.net>
> ---
> meson.build | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/meson.build b/meson.build
> index 469723dc4633..c5aab78716d5 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -11,7 +11,6 @@ cc = meson.get_compiler('c')
>
> cc_args = [
> '-Wbad-function-cast',
> - '-Wdeclaration-after-statement',
> '-Wformat=2',
> # igt_assert(0) in switch statements triggers a bunch of this.
> '-Wimplicit-fallthrough=0',

--
Jani Nikula, Intel Open Source Graphics Center