Re: [PATCH v4] warning about const multidimensional array as function parameter

2014-12-03 Thread Joseph Myers
On Mon, 10 Nov 2014, Martin Uecker wrote: + if (OPT_Wdiscarded_array_qualifiers OPT_Wdiscarded_array_qualifiers is an enum constant, so it doesn't make sense to test it in if conditions like this. You don't need a test in the if condition for whether the warning is enabled - passing

[PATCH v4] warning about const multidimensional array as function parameter

2014-11-10 Thread Martin Uecker
For completeness, this version adds the missing warning if the 'const' is lost in a conditional expression with a void* on the other branch. The only code change relative to the previous version is in c/c-typeck.c in build_conditional_expr (otherwise I added the warnings to the testsuite and