From: "Theodore Y. Ts'o" <tytso@mit.edu>
To: Matthew Wilcox <willy@infradead.org>
Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org,
Dan Carpenter <dan.carpenter@oracle.com>,
Andreas Dilger <adilger.kernel@dilger.ca>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Michal Marek <michal.lkml@markovi.net>,
Steven Rostedt <rostedt@goodmis.org>,
Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
Olof Johansson <olof@lxom.net>,
Konstantin Ryabitsev <konstantin@linuxfoundation.org>,
"David S . Miller" <davem@davemloft.net>,
Andrey Ryabinin <aryabinin@virtuozzo.com>,
Kees Cook <keescook@chromium.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@kernel.org>,
Paul Lawrence <paullawrence@google.com>,
Sandipan Das <sandipan@linux.vnet.ibm.com>
Subject: Re: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)
Date: Mon, 22 Oct 2018 02:58:00 -0400 [thread overview]
Message-ID: <20181022065800.GK1617@thunk.org> (raw)
In-Reply-To: <20181022004217.GA4941@bombadil.infradead.org>
[-- Attachment #1: Type: text/plain, Size: 643 bytes --]
On Sun, Oct 21, 2018 at 05:42:18PM -0700, Matthew Wilcox wrote:
> On Sun, Oct 21, 2018 at 07:14:13PM +0200, Miguel Ojeda wrote:
> > +#if __has_attribute(__fallthrough__)
> > +# define __fallthrough __attribute__((__fallthrough__))
> > +#else
> > +# define __fallthrough
> > +#endif
>
> Why is the #else not:
>
> # define __fallthrough /* fallthrough */
>
> Would this solve the Coverity problem, or does Coverity look at the raw
> source code before preprocessing?
Wouldn't the "/* ... */" be eaten by the preprocessor before defining
the __fallthrough cpp macro? (e.g., try running the attached script)
- Ted
[-- Attachment #2: foo --]
[-- Type: text/plain, Size: 126 bytes --]
#!/bin/bash
cat << EOF > /tmp/test$$.c
#define foobar quux /* foobar */
foobar
EOF
gcc -E /tmp/test$$.c
rm -f /tmp/test$$.c
next prev parent reply other threads:[~2018-10-22 6:58 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-21 17:14 [PATCH 0/2] Compiler Attributes: __fallthrough Miguel Ojeda
2018-10-21 17:14 ` [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1) Miguel Ojeda
2018-10-21 22:27 ` Theodore Y. Ts'o
[not found] ` <CANiq72mXV6WTyHXNZJDTfFOpPrXD0zD6cB30bGOuKO44AvRiog@mail.gmail.com>
2018-10-22 9:34 ` Kees Cook
2018-10-22 9:41 ` Miguel Ojeda
2018-10-22 9:43 ` Miguel Ojeda
2018-10-22 17:17 ` Nick Desaulniers
2018-10-22 20:59 ` Miguel Ojeda
2018-10-22 10:53 ` Kees Cook
2018-10-22 11:24 ` Miguel Ojeda
2018-10-22 13:39 ` Miguel Ojeda
2018-10-22 17:23 ` Nick Desaulniers
[not found] ` <8fb78062-b6d4-6f2d-d943-44bec6b95ff0@petrovitsch.priv.at>
2018-10-22 10:27 ` Dan Carpenter
2018-10-22 10:45 ` Bernd Petrovitsch
2018-10-22 10:53 ` Dan Carpenter
2018-10-22 11:07 ` Miguel Ojeda
2018-10-22 17:49 ` Bernd Petrovitsch
2018-10-22 17:54 ` Nick Desaulniers
2018-10-22 18:13 ` Bernd Petrovitsch
2018-10-22 21:34 ` Miguel Ojeda
2018-10-22 17:26 ` Nick Desaulniers
2018-10-22 0:42 ` Matthew Wilcox
2018-10-22 6:58 ` Theodore Y. Ts'o [this message]
2018-10-22 9:32 ` Miguel Ojeda
2018-10-22 12:07 ` Luc Van Oostenryck
2018-10-22 12:09 ` Miguel Ojeda
2018-10-22 17:36 ` Nick Desaulniers
2018-10-22 21:17 ` Miguel Ojeda
2018-10-21 17:14 ` [PATCH 2/2] Compiler Attributes: auxdisplay: panel: use __fallthrough Miguel Ojeda
2018-10-21 18:11 ` Joe Perches
2018-10-22 9:51 ` Miguel Ojeda
2018-10-22 15:48 ` Joe Perches
2018-10-22 14:10 ` Kees Cook
[not found] ` <20181023053542.lsklua2p3lnbkqir@mwanda>
2018-11-02 10:49 ` Miguel Ojeda
2018-11-02 10:56 ` Miguel Ojeda
2018-10-21 18:29 ` [PATCH 0/2] Compiler Attributes: __fallthrough Greg Kroah-Hartman
2018-10-21 18:52 ` Joe Perches
2018-10-22 5:27 ` Dan Carpenter
2018-10-22 9:48 ` Miguel Ojeda
2018-10-22 16:54 ` Nick Desaulniers
2018-10-22 21:23 ` Miguel Ojeda
2018-10-23 5:43 ` Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181022065800.GK1617@thunk.org \
--to=tytso@mit.edu \
--cc=adilger.kernel@dilger.ca \
--cc=aryabinin@virtuozzo.com \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=keescook@chromium.org \
--cc=konstantin@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab+samsung@kernel.org \
--cc=michal.lkml@markovi.net \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=mingo@kernel.org \
--cc=olof@lxom.net \
--cc=paullawrence@google.com \
--cc=rostedt@goodmis.org \
--cc=sandipan@linux.vnet.ibm.com \
--cc=tglx@linutronix.de \
--cc=willy@infradead.org \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).