Please, take '-Wmisleading-indentation' out of -Wall
Andrew Haley
aph@redhat.com
Fri May 6 12:25:00 GMT 2016
On 05/05/2016 07:56 PM, Antonio Diaz Diaz wrote:
> Take this example http://gcc.gnu.org/ml/gcc-patches/2016-03/msg00261.html
>
> The user sees this:
>
> if (flagA) // GUARD
> foo (0); // BODY
> #if SOME_CONDITION_THAT_DOES_NOT_HOLD
> if (flagB)
> #endif
> foo (1); // NEXT
Surely this misleading code is exactly what we should be warning about.
It could be like this, and far less misleadingly:
if (flagA) // GUARD
foo (0); // BODY
#if SOME_CONDITION_THAT_DOES_NOT_HOLD
if (flagB)
#endif
{
foo (1); // NEXT
}
Better for the reader, nothing to warn about.
Andrew.
More information about the Gcc
mailing list