Re: [PATCH] compiler_attributes.h: Support no_sanitize_undefined check with GCC 4

From: Miguel Ojeda
Date: Tue Jun 16 2020 - 09:09:48 EST


Hi Marco,

On Tue, Jun 16, 2020 at 1:15 AM Marco Elver <elver@xxxxxxxxxx> wrote:
>
> UBSAN is supported since GCC 4.9, which unfortunately did not yet have
> __has_attribute(). To work around, the __GCC4_has_attribute workaround
> requires defining which compiler version supports the given attribute.
>
> In the case of no_sanitize_undefined, it is the first version that
> supports UBSAN, which is GCC 4.9.
>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Signed-off-by: Marco Elver <elver@xxxxxxxxxx>
> ---

I am happy to see the `__GCC4_has_attribute` workaround is useful
outside the file, too (originally the list was meant to be used inside
the file itself, but I see it is good to reuse it).

Reviewed-by: Miguel Ojeda <miguel.ojeda.sandonis@xxxxxxxxx>

Cheers,
Miguel