Re: [PATCH 1/2] [RFC] kbuild: add macro for controlling warnings to linux/compiler.h

From: Arnd Bergmann
Date: Tue Dec 05 2017 - 15:30:17 EST


On Tue, Dec 5, 2017 at 8:25 PM, Kees Cook <keescook@xxxxxxxxxxxx> wrote:

> I like this. I wonder if it would be a good idea to add an additional
> argument that forces documentation of the reason for adding a diag
> marking? Something like:
>
> __diag_warn(GCC_7, vla, "No VLAs should be used in this code");

This would be similar to what glibc does, it names the (ignore) macro
DIAG_IGNORE_NEEDS_COMMENT(), and by convention requires
a comment block in front of it. Not sure if it will actually work in the kernel
where the reviews are much more scattered across subsystem maintainers,
but we could try it.

Arnd