[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANiq72=n97YAJEMtgQFJbRP=Mt-SqznX0xcqxxXeeiXCPTqpoA@mail.gmail.com>
Date: Tue, 11 Mar 2025 00:04:02 +0100
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Kees Cook <kees@...nel.org>
Cc: Miguel Ojeda <ojeda@...nel.org>, Arnd Bergmann <arnd@...db.de>,
"Rafael J. Wysocki" <rafael@...nel.org>, Len Brown <lenb@...nel.org>, Marco Elver <elver@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>, Przemek Kitszel <przemyslaw.kitszel@...el.com>,
Hao Luo <haoluo@...gle.com>, Masahiro Yamada <masahiroy@...nel.org>,
Christophe Leroy <christophe.leroy@...roup.eu>, Johannes Weiner <hannes@...xchg.org>,
linux-acpi@...r.kernel.org, Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <nick.desaulniers+lkml@...il.com>, Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Alexander Potapenko <glider@...gle.com>, Yafang Shao <laoar.shao@...il.com>,
Jan Hendrik Farr <kernel@...rr.cc>, Tony Ambardar <tony.ambardar@...il.com>,
Alexander Lobakin <aleksander.lobakin@...el.com>, Alice Ryhl <aliceryhl@...gle.com>,
Tejun Heo <tj@...nel.org>, Yoann Congal <yoann.congal@...le.fr>,
Roman Gushchin <roman.gushchin@...ux.dev>, Jens Axboe <axboe@...nel.dk>,
Chen Ridong <chenridong@...wei.com>, Mark Rutland <mark.rutland@....com>,
Jann Horn <jannh@...gle.com>, Vincent Guittot <vincent.guittot@...aro.org>,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH] compiler_types: Introduce __nonstring_array
On Mon, Mar 10, 2025 at 10:42 PM Kees Cook <kees@...nel.org> wrote:
>
> GCC has expanded support of the "nonstring" attribute so that it can be
> applied to arrays of character arrays[1], which is needed to identify
> correct static initialization of those kinds of objects. Since this was
> not supported prior to GCC 15, we need to distinguish the usage of Linux's
> existing __nonstring macro for the attribute for non-multi-dimensional
> char arrays. Until GCC 15 is the minimum version, use __nonstring_array to
> mark arrays of non-string character arrays. (Regular non-string character
> arrays can continue to use __nonstring.)
Sounds reasonable. So this means that, when the GCC minimum goes over
15 in some years, we can both remove it and move it to
`compiler_attributes.h`, right?
Perhaps we should mention part of this commit message (or the sentence
above) in the comment to clarify (it will also help to clarify what
that "only supported since GCC >= 15" means).
If you are going to use it in a series that has a use case:
Acked-by: Miguel Ojeda <ojeda@...nel.org>
Thanks!
Cheers,
Miguel
Powered by blists - more mailing lists