From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Masahiro Yamada <masahiroy@kernel.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Nicolas Schier <nicolas@fjasle.eu>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: Re: [PATCH][next] Makefile: Enable -Wstringop-overflow globally
Date: Thu, 16 Nov 2023 08:18:43 -0600 [thread overview]
Message-ID: <e385a095-c6ea-4db5-ab7c-7221593dc6c3@embeddedor.com> (raw)
In-Reply-To: <CAK7LNAR1i8HP8E3UmmSggZMka+UbJswU_bVMyxmRt4CbQhoTAA@mail.gmail.com>
On 11/16/23 05:23, Masahiro Yamada wrote:
> On Thu, Nov 16, 2023 at 12:27 PM Gustavo A. R. Silva
> <gustavoars@kernel.org> wrote:
>>
>> It seems that we have finished addressing all the remaining
>> issues regarding compiler option -Wstringop-overflow. So, we
>> are now in good shape to enable this compiler option globally.
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
>> ---
>> Makefile | 3 +++
>> scripts/Makefile.extrawarn | 2 --
>> 2 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 690cde550acd..452b7d0e19e9 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -985,6 +985,9 @@ NOSTDINC_FLAGS += -nostdinc
>> # perform bounds checking.
>> KBUILD_CFLAGS += $(call cc-option, -fstrict-flex-arrays=3)
>>
>> +# We are now in good shape to enable this option.
>
> Please remove this comment.
>
> It it fine to mention it in the commit log, but
> not in the Makefile.
Sure thing. I'll change that and add this patch to my -next tree.
>
>
>
> I hope somebody will double-check this patch in CI infrastructure.
I'll take care of that.
Thanks
--
Gustavo
>
>
>
>
>> +KBUILD_CFLAGS += $(call cc-option, -Wstringop-overflow)
>> +
>> # disable invalid "can't wrap" optimizations for signed / pointers
>> KBUILD_CFLAGS += -fno-strict-overflow
>>
>> diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
>> index 2fe6f2828d37..1527199161d7 100644
>> --- a/scripts/Makefile.extrawarn
>> +++ b/scripts/Makefile.extrawarn
>> @@ -106,7 +106,6 @@ KBUILD_CFLAGS += $(call cc-option, -Wunused-const-variable)
>> KBUILD_CFLAGS += $(call cc-option, -Wpacked-not-aligned)
>> KBUILD_CFLAGS += $(call cc-option, -Wformat-overflow)
>> KBUILD_CFLAGS += $(call cc-option, -Wformat-truncation)
>> -KBUILD_CFLAGS += $(call cc-option, -Wstringop-overflow)
>> KBUILD_CFLAGS += $(call cc-option, -Wstringop-truncation)
>>
>> KBUILD_CPPFLAGS += -Wundef
>> @@ -122,7 +121,6 @@ KBUILD_CFLAGS += $(call cc-disable-warning, restrict)
>> KBUILD_CFLAGS += $(call cc-disable-warning, packed-not-aligned)
>> KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow)
>> KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation)
>> -KBUILD_CFLAGS += $(call cc-disable-warning, stringop-overflow)
>> KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation)
>>
>> ifdef CONFIG_CC_IS_CLANG
>> --
>> 2.34.1
>>
>
>
prev parent reply other threads:[~2023-11-16 14:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-16 3:27 Gustavo A. R. Silva
2023-11-16 11:23 ` Masahiro Yamada
2023-11-16 14:18 ` Gustavo A. R. Silva [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e385a095-c6ea-4db5-ab7c-7221593dc6c3@embeddedor.com \
--to=gustavo@embeddedor.com \
--cc=gustavoars@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=nicolas@fjasle.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®