linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Laura Abbott <labbott@redhat.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Bernd Edlinger <bernd.edlinger@hotmail.de>,
	Martin Sebor <msebor@gmail.com>,
	Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Subject: Re: [RFC][PATCH] Update -Wattribute-alias for gcc9
Date: Fri, 25 Jan 2019 11:58:21 +0100	[thread overview]
Message-ID: <CAK8P3a0xnc7RNbGhG7-hj+ay2keR7dh7MmDiUNKxfewsnatsgA@mail.gmail.com> (raw)
In-Reply-To: <20190125104353.2791-1-labbott@redhat.com>

On Fri, Jan 25, 2019 at 11:43 AM Laura Abbott <labbott@redhat.com> wrote:
>
> Commit bee20031772a ("disable -Wattribute-alias warning for
> SYSCALL_DEFINEx()") disabled -Wattribute-alias with gcc8.
> gcc9 changed the format of -Wattribute-alias to take a parameter.
> This doesn't quite match with the existing disabling mechanism
> so update for gcc9 to match with the default (-Wattribute-alias=1).
>
> Signed-off-by: Laura Abbott <labbott@redhat.com>
> ---
> This is RFC because it feels ugly. I went ahead and did the obvious fixup
> but it's worth discussing if we're going to end up with an explosion or
> if there's a better way to handle this in one macro.

Bernd Edlinger has sent a patch to gcc for this:
https://gcc.gnu.org/ml/gcc-patches/2019-01/msg01120.html

and Miguel Ojeda said he wanted to send a patch for it to the
kernel as well, not sure if he wanted to take a different
approach there, so adding both to Cc here.

        Arnd




> ---
>  include/linux/compat.h       | 2 ++
>  include/linux/compiler-gcc.h | 7 ++++++-
>  include/linux/syscalls.h     | 2 ++
>  3 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/compat.h b/include/linux/compat.h
> index 056be0d03722..d5d7700f26a6 100644
> --- a/include/linux/compat.h
> +++ b/include/linux/compat.h
> @@ -75,6 +75,8 @@
>         __diag_push();                                                          \
>         __diag_ignore(GCC, 8, "-Wattribute-alias",                              \
>                       "Type aliasing is used to sanitize syscall arguments");\
> +       __diag_ignore(GCC, 9, "-Wattribute-alias=1",                            \
> +                     "Type aliasing is used to sanitize syscall arguments");\
>         asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));       \
>         asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))        \
>                 __attribute__((alias(__stringify(__se_compat_sys##name))));     \
> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
> index e8579412ad21..75079668344c 100644
> --- a/include/linux/compiler-gcc.h
> +++ b/include/linux/compiler-gcc.h
> @@ -165,8 +165,13 @@
>  #define __diag_str(s)          __diag_str1(s)
>  #define __diag(s)              _Pragma(__diag_str(GCC diagnostic s))
>
> -#if GCC_VERSION >= 80000
> +#if GCC_VERSION >= 90000
> +#define __diag_GCC_8(s)
> +#define __diag_GCC_9(s)                __diag(s)
> +#elif GCC_VERSION >= 80000
>  #define __diag_GCC_8(s)                __diag(s)
> +#define __diag_GCC_9(s)
>  #else
>  #define __diag_GCC_8(s)
> +#define __diag_GCC_9(s)
>  #endif
> diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
> index 257cccba3062..a08059e1ccf4 100644
> --- a/include/linux/syscalls.h
> +++ b/include/linux/syscalls.h
> @@ -236,6 +236,8 @@ static inline int is_syscall_trace_event(struct trace_event_call *tp_event)
>         __diag_push();                                                  \
>         __diag_ignore(GCC, 8, "-Wattribute-alias",                      \
>                       "Type aliasing is used to sanitize syscall arguments");\
> +       __diag_ignore(GCC, 9, "-Wattribute-alias=1",                    \
> +                     "Type aliasing is used to sanitize syscall arguments");\
>         asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))       \
>                 __attribute__((alias(__stringify(__se_sys##name))));    \
>         ALLOW_ERROR_INJECTION(sys##name, ERRNO);                        \
> --
> 2.20.1
>

  reply	other threads:[~2019-01-25 10:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-25 10:43 [RFC][PATCH] Update -Wattribute-alias for gcc9 Laura Abbott
2019-01-25 10:58 ` Arnd Bergmann [this message]
2019-01-25 11:39   ` Miguel Ojeda
2019-01-25 12:24     ` Bernd Edlinger
2019-01-28 13:28       ` Bernd Edlinger
2019-01-28 14:35         ` Laura Abbott
2019-01-28 14:40         ` Arnd Bergmann

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=CAK8P3a0xnc7RNbGhG7-hj+ay2keR7dh7MmDiUNKxfewsnatsgA@mail.gmail.com \
    --to=arnd@arndb.de \
    --cc=bernd.edlinger@hotmail.de \
    --cc=labbott@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=msebor@gmail.com \
    --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).