
Couple of interesting blog posts <https://gnu.wildebeest.org/blog/mjw/2016/02/15/looking-forward-to-gcc6-many-new-warnings/>, <https://gnu.wildebeest.org/blog/mjw/2016/01/09/looking-forward-to-gcc6-nice-new-warnings/> about new dubious-looking constructs that the GCC 6 C and C++ compilers can pick up. I particularly like the latter, which warns against a situation like the following: if (cond) statement_guarded_by_cond; statement_not_guarded_by_cond; /* though it may look like it is */ Of course, this only works in a language that allows the redundancy of having both bracketing symbols and indentation. This is why trying to get rid of one, and having the other do duty for both--is such a bad idea.

On Tue, Feb 16, 2016 at 10:42:20AM +1300, Lawrence D'Oliveiro wrote:
Couple of interesting blog posts <https://gnu.wildebeest.org/blog/mjw/2016/02/15/looking-forward-to-gcc6-many-new-warnings/>, <https://gnu.wildebeest.org/blog/mjw/2016/01/09/looking-forward-to-gcc6-nice-new-warnings/> about new dubious-looking constructs that the GCC 6 C and C++ compilers can pick up. I particularly like the latter, which warns against a situation like the following:
if (cond) statement_guarded_by_cond; statement_not_guarded_by_cond; /* though it may look like it is */
Might depend on whether you have the tab size set to the value used by the programmer. I have seen false reports from gcc-6 about indentation in the Debian bug system because gcc-6 makes an assumption that a tab is eight spaces. I have also seen false error reports for indentation that you or I might not use but I imagine that a programmer familiar or embued in such a coding style would not misread or misunderstand the code. I find it offensive that a compiler would warn on such things. What arrogance! As you might infer, I don't like this sort of reporting from the compiler. It is *not* the place of the compiler to enforce (or even comment on) coding style. If one is concerned about indentation in code then run it through an auto-indenter. Cheers Michael.

On Tue, 16 Feb 2016 15:03:34 +1300, Michael Cree wrote:
It is *not* the place of the compiler to enforce (or even comment on) coding style.
Having the option can be useful. Though I agree I can’t stand languages that make it compulsory (*cough* Java definite-assignment rules *cough*).
participants (2)
-
Lawrence D'Oliveiro
-
Michael Cree