Re: [PATCH] Use fall-through attribute rather than magic comments

From: Gustavo A. R. Silva
Date: Sat Mar 16 2019 - 17:42:40 EST


Shawn,

On 3/15/19 10:38 PM, Shawn Landden wrote:
> The -Wimplicit-fallthrough warning recognizes magic comments
> https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/
> It is my opinion that magic comments are a bad idea. Comments should not
> change the interpretation (even regarding errors) of C code.
> (It also happens to break distcc as distcc compiles pre-processed .i files.)
>

This is not the first time we discuss this topic. Please, read the archive.

We are going to complete the ongoing work first and, after that, I personally
will consider applying this kind of tree-wide change, or any other that may
serve to the same purpose, to my tree. At this moment this change will only
create confusion and potentially bring a halt to the main idea behind all this,
which is to enable -Wimplicit-fallthrough. There are only ~100 of these warnings
left in linux-next.

Having said that, please, cultivate the practice of showing every code you touch
to a compiler first before proposing any patches. Otherwise, your opinions and
ideas won't be that popular.

Also, if your intention was to do a tree-wide change to replace all the existing
fall-through comments, you failed to take into account all the info contained
in the article you mention, which by the way is incomplete.

Thanks
--
Gustavo