Reading the GCC 6 Release Series Changes, New Features, and Fixes I find very interesting the new option -Wmisleading-indentation
:
-Wmisleading-indentation warns about places where the indentation of the code
gives a misleading idea of the block structure of the code to a human reader.
For example, given CVE-2014-1266:
sslKeyExchange.c: In function 'SSLVerifySignedServerKeyExchange':
sslKeyExchange.c:631:8: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
goto fail;
^~~~
sslKeyExchange.c:629:4: note: ...this 'if' clause, but it is not
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0)
^~
I am just wondering how the option can recognize reliable these kind of misleading indentation when the tab space
is "unknown" to gcc
due to the fact it can be 4 or 8 or even what ever...