Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1600034

Re: [PATCH] Kbuild: support designated_init attribute

From Masahiro Yamada <yamada.masahiro@socionext.com>
Newsgroups linux.kernel
Subject Re: [PATCH] Kbuild: support designated_init attribute
Date 2017-03-14 06:30 +0100
Message-ID <tkNbX-3N3-1@gated-at.bofh.it> (permalink)
References <t6cci-4aK-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Kees,


2017-02-02 8:04 GMT+09:00 Kees Cook <keescook@chromium.org>:
> If a structure is marked with __attribute__((designated_init)) from
> GCC or Sparse, it needs to have all static initializers using designated
> initialization. Fail the build for any missing cases. This attribute will
> be used by the randstruct plugin to make sure randomized structures are
> being correctly initialized.
>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
>  Makefile | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index 96b27a888285..d4e0550e7abd 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -793,6 +793,9 @@ KBUILD_CFLAGS   += $(call cc-option,-Werror=date-time)
>  # enforce correct pointer usage
>  KBUILD_CFLAGS   += $(call cc-option,-Werror=incompatible-pointer-types)
>
> +# Require designated initializers for all marked structures
> +KBUILD_CFLAGS   += $(call cc-option,-Werror=designated-init)
> +
>  # use the deterministic mode of AR if available
>  KBUILD_ARFLAGS := $(call ar-option,D)
>


The code looks OK to me.

As far as I understood, this patch changes
designated-init warnings into errors.  Correct?

If so, I think the commit subject "Kbuild: support designated_init attribute"
does not directly describe what this patch does.




-- 
Best Regards
Masahiro Yamada

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH] Kbuild: support designated_init attribute Masahiro Yamada <yamada.masahiro@socionext.com> - 2017-03-14 06:30 +0100

csiph-web