* [PATCH v1] kbuild: enforce -Werror=unused-result
@ 2020-11-17 10:47 Olaf Hering
2020-12-01 10:42 ` Masahiro Yamada
0 siblings, 1 reply; 3+ messages in thread
From: Olaf Hering @ 2020-11-17 10:47 UTC (permalink / raw)
To: linux-kbuild, linux-kernel; +Cc: Olaf Hering, Masahiro Yamada, Michal Marek
It is a hard error if a return value is ignored.
In case the return value has no meaning, remove the attribute.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index e2c3f65c4721..c7f9acffad42 100644
--- a/Makefile
+++ b/Makefile
@@ -497,7 +497,7 @@ KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-PIE
KBUILD_CFLAGS := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
-Werror=implicit-function-declaration -Werror=implicit-int \
- -Werror=return-type -Wno-format-security \
+ -Werror=return-type -Werror=unused-result -Wno-format-security \
-std=gnu89
KBUILD_CPPFLAGS := -D__KERNEL__
KBUILD_AFLAGS_KERNEL :=
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1] kbuild: enforce -Werror=unused-result
2020-11-17 10:47 [PATCH v1] kbuild: enforce -Werror=unused-result Olaf Hering
@ 2020-12-01 10:42 ` Masahiro Yamada
2020-12-21 6:31 ` Masahiro Yamada
0 siblings, 1 reply; 3+ messages in thread
From: Masahiro Yamada @ 2020-12-01 10:42 UTC (permalink / raw)
To: Olaf Hering
Cc: Linux Kbuild mailing list, Linux Kernel Mailing List, Michal Marek
On Tue, Nov 17, 2020 at 7:47 PM Olaf Hering <olaf@aepfle.de> wrote:
>
> It is a hard error if a return value is ignored.
> In case the return value has no meaning, remove the attribute.
>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
Applied to linux-kbuild.
Thanks.
> ---
> Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index e2c3f65c4721..c7f9acffad42 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -497,7 +497,7 @@ KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-PIE
> KBUILD_CFLAGS := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
> -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
> -Werror=implicit-function-declaration -Werror=implicit-int \
> - -Werror=return-type -Wno-format-security \
> + -Werror=return-type -Werror=unused-result -Wno-format-security \
> -std=gnu89
> KBUILD_CPPFLAGS := -D__KERNEL__
> KBUILD_AFLAGS_KERNEL :=
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1] kbuild: enforce -Werror=unused-result
2020-12-01 10:42 ` Masahiro Yamada
@ 2020-12-21 6:31 ` Masahiro Yamada
0 siblings, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2020-12-21 6:31 UTC (permalink / raw)
To: Olaf Hering
Cc: Linux Kbuild mailing list, Linux Kernel Mailing List, Michal Marek
On Tue, Dec 1, 2020 at 7:42 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> On Tue, Nov 17, 2020 at 7:47 PM Olaf Hering <olaf@aepfle.de> wrote:
> >
> > It is a hard error if a return value is ignored.
> > In case the return value has no meaning, remove the attribute.
> >
> > Signed-off-by: Olaf Hering <olaf@aepfle.de>
>
> Applied to linux-kbuild.
> Thanks.
I will postpone this by the next MW.
Some instances of __must_check violation are still remaining,
which end up with build breakages.
>
> > ---
> > Makefile | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/Makefile b/Makefile
> > index e2c3f65c4721..c7f9acffad42 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -497,7 +497,7 @@ KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-PIE
> > KBUILD_CFLAGS := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
> > -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
> > -Werror=implicit-function-declaration -Werror=implicit-int \
> > - -Werror=return-type -Wno-format-security \
> > + -Werror=return-type -Werror=unused-result -Wno-format-security \
> > -std=gnu89
> > KBUILD_CPPFLAGS := -D__KERNEL__
> > KBUILD_AFLAGS_KERNEL :=
>
>
>
> --
> Best Regards
> Masahiro Yamada
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-12-21 6:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-17 10:47 [PATCH v1] kbuild: enforce -Werror=unused-result Olaf Hering
2020-12-01 10:42 ` Masahiro Yamada
2020-12-21 6:31 ` Masahiro Yamada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).