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


Groups > linux.kernel > #1600034

Re: [PATCH] Kbuild: support designated_init attribute

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Masahiro Yamada <yamada.masahiro@socionext.com>
Newsgroups linux.kernel
Subject Re: [PATCH] Kbuild: support designated_init attribute
Date Tue, 14 Mar 2017 06:30:01 +0100
Message-ID <tkNbX-3N3-1@gated-at.bofh.it> (permalink)
References <t6cci-4aK-15@gated-at.bofh.it>
Dkim-Filter OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com v2E5NMOZ018129
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1489469003; bh=n8OSOqu+da9gdFkgfi48M3sBtDT28W8qlGanmftXEkM=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=SixFr1RLkOEzbaYnAK5dS6gEjDEE0cFtqEh92RnE2bgoZgj3TX5G0uAAFX5DBiUaX mycGtx3QSvZ/w9qn0ulxj4zixbysaIKMAQT9SJYSQbYb1lIBHCnTIBQ1FBRksTkAcZ pZ4j5Gxffw9ptDkvrQccN0W8yn8etP8hOnboM1BtPHoWIfHfJJM2jwTVGTOBmXG/9O 3jX+9rm0/qOzolXvJnJvEyE/fxDV04m58hjcYOBr8LCzCwH1a8VgTSwPCFs9NxM7tg jZfrXNCCt+I3y+VJCSbbvifeRJyTxRF6TxpsmVpho3gBq7QdZGIPUNOuNl2QLV+Aal N5NjlhY9cORGg==
X-Nifty-Srcip [209.85.161.178]
X-Gm-Message-State AMke39lJl+8JzgTwcELfx+Z5qtY7Wv8GdNFRjBhZ3hSo6czEwJwFiA2VNbwJWIdXZn8Ld02sDjL3tiaKbKNPHg==
X-Received by 10.129.179.132 with SMTP id r126mr22185578ywh.70.1489469002332; Mon, 13 Mar 2017 22:23:22 -0700 (PDT)
MIME-Version 1.0
X-Gmail-Original-Message-ID <CAK7LNAQROQ=Gp_-fXf7nkEESKrXqSHRp10rkYxL3+NkcHdO3vA@mail.gmail.com>
Content-Type text/plain; charset=UTF-8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 45
Organization linux.* mail to news gateway
X-Original-Cc Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, Michal Marek <mmarek@suse.com>, Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>
X-Original-Date Tue, 14 Mar 2017 14:23:21 +0900
X-Original-Message-ID <CAK7LNAQROQ=Gp_-fXf7nkEESKrXqSHRp10rkYxL3+NkcHdO3vA@mail.gmail.com>
X-Original-References <20170201230425.GA75891@beast>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1600034

Show key headers only | 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