Re: [PATCH 3/4] ubsan: Force -Wno-maybe-uninitialized only for GCC

From: Kees Cook
Date: Tue Oct 06 2020 - 02:03:54 EST


On Sun, Oct 04, 2020 at 12:16:14AM -0700, Nathan Chancellor wrote:
> On Fri, Oct 02, 2020 at 03:15:26PM -0700, Kees Cook wrote:
> > Clang handles 'maybe-uninitialized' better in the face of using UBSAN,
> > so do not make this universally disabled for UBSAN builds.
> >
> > Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx>
>
> Well this patch is not strictly necessary because Clang does not support
> -Wmaybe-uninitialized anyways :) its flags are -Wuninitialized and
> -Wsometimes-uninitialized so the warning stays enabled for UBSAN as it
> stands.

Ah, yes. Heh. Well... perhaps I can just drop this patch.

> However, something like this could still worthwhile because it would
> save us one call to cc-disable-warning (yay micro optimizations).
>
> Maybe it just does not need to have a whole new symbol, just make it
>
> ubsan-cflags-$(CONFIG_CC_IS_GCC)
>
> instead of
>
> ubsan-cflags-$(CONFIG_UBSAN)

If it gets kept, I'd still like it gated on CONFIG_UBSAN in some way
(e.g. the patch has an implicit depends due to the "if UBSAN" section).

But yes, this patch is rather a no-op.

--
Kees Cook