linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] Makefile.extrawarn: Turn off -Werror when extra warnings are enabled
@ 2022-03-25 13:13 Andy Shevchenko
  2022-03-25 14:34 ` Masahiro Yamada
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Andy Shevchenko @ 2022-03-25 13:13 UTC (permalink / raw)
  To: Andy Shevchenko, linux-kbuild, linux-kernel
  Cc: Masahiro Yamada, Michal Marek, Nick Desaulniers, Borislav Petkov,
	Ingo Molnar, Linus Torvalds, Peter Zijlstra

When `make W=1 ...` is executed the level 1 warnings become errors,
due to recent change in some of the defconfigs, and fail the build.
Since there are a lot of warnings on the level 1 are still present
in the defconfigs at least for x86, let disable -Werror in such case.

Fixes: b9080ba4a6ec ("x86/defconfig: Enable WERROR")
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 scripts/Makefile.extrawarn | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
index 650d0b8ceec3..c81d74ef6c90 100644
--- a/scripts/Makefile.extrawarn
+++ b/scripts/Makefile.extrawarn
@@ -94,3 +94,10 @@ KBUILD_CFLAGS += $(call cc-option, -Wpacked-bitfield-compat)
 KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN3
 
 endif
+
+#
+# Turn off -Werror when extra warnings are enabled
+#
+ifneq ($(KBUILD_EXTRA_WARN),)
+	KBUILD_CFLAGS += -Wno-error
+endif
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/1] Makefile.extrawarn: Turn off -Werror when extra warnings are enabled
  2022-03-25 13:13 [PATCH v1 1/1] Makefile.extrawarn: Turn off -Werror when extra warnings are enabled Andy Shevchenko
@ 2022-03-25 14:34 ` Masahiro Yamada
  2022-03-25 14:53   ` Andy Shevchenko
  2022-03-25 17:20   ` Linus Torvalds
  2022-03-25 17:18 ` Linus Torvalds
  2022-03-25 20:01 ` kernel test robot
  2 siblings, 2 replies; 7+ messages in thread
From: Masahiro Yamada @ 2022-03-25 14:34 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Linux Kbuild mailing list, Linux Kernel Mailing List,
	Michal Marek, Nick Desaulniers, Borislav Petkov, Ingo Molnar,
	Linus Torvalds, Peter Zijlstra

On Fri, Mar 25, 2022 at 10:13 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> When `make W=1 ...` is executed the level 1 warnings become errors,
> due to recent change in some of the defconfigs, and fail the build.
> Since there are a lot of warnings on the level 1 are still present
> in the defconfigs at least for x86, let disable -Werror in such case.


commit b339ec9c229aaf399296a120d7be0e34fbc355ca
made WERROR default to COMPILE_TEST.

WERROR should not be enabled for regular builds.

b9080ba4a6ec should be reverted.





> Fixes: b9080ba4a6ec ("x86/defconfig: Enable WERROR")
> Suggested-by: Peter Zijlstra <peterz@infradead.org>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  scripts/Makefile.extrawarn | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
> index 650d0b8ceec3..c81d74ef6c90 100644
> --- a/scripts/Makefile.extrawarn
> +++ b/scripts/Makefile.extrawarn
> @@ -94,3 +94,10 @@ KBUILD_CFLAGS += $(call cc-option, -Wpacked-bitfield-compat)
>  KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN3
>
>  endif
> +
> +#
> +# Turn off -Werror when extra warnings are enabled
> +#
> +ifneq ($(KBUILD_EXTRA_WARN),)
> +       KBUILD_CFLAGS += -Wno-error
> +endif
> --
> 2.35.1
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/1] Makefile.extrawarn: Turn off -Werror when extra warnings are enabled
  2022-03-25 14:34 ` Masahiro Yamada
@ 2022-03-25 14:53   ` Andy Shevchenko
  2022-03-25 17:20   ` Linus Torvalds
  1 sibling, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2022-03-25 14:53 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Linux Kbuild mailing list, Linux Kernel Mailing List,
	Michal Marek, Nick Desaulniers, Borislav Petkov, Ingo Molnar,
	Linus Torvalds, Peter Zijlstra

On Fri, Mar 25, 2022 at 11:34:06PM +0900, Masahiro Yamada wrote:
> On Fri, Mar 25, 2022 at 10:13 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > When `make W=1 ...` is executed the level 1 warnings become errors,
> > due to recent change in some of the defconfigs, and fail the build.
> > Since there are a lot of warnings on the level 1 are still present
> > in the defconfigs at least for x86, let disable -Werror in such case.
> 
> 
> commit b339ec9c229aaf399296a120d7be0e34fbc355ca
> made WERROR default to COMPILE_TEST.
> 
> WERROR should not be enabled for regular builds.
> 
> b9080ba4a6ec should be reverted.

Hmm... works for me, but have you read this discussion:

https://lore.kernel.org/r/YjsCpoRK7W4l6tSh@zn.tnic

?

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/1] Makefile.extrawarn: Turn off -Werror when extra warnings are enabled
  2022-03-25 13:13 [PATCH v1 1/1] Makefile.extrawarn: Turn off -Werror when extra warnings are enabled Andy Shevchenko
  2022-03-25 14:34 ` Masahiro Yamada
@ 2022-03-25 17:18 ` Linus Torvalds
  2022-03-25 17:51   ` Andy Shevchenko
  2022-03-25 20:01 ` kernel test robot
  2 siblings, 1 reply; 7+ messages in thread
From: Linus Torvalds @ 2022-03-25 17:18 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Linux Kbuild mailing list, Linux Kernel Mailing List,
	Masahiro Yamada, Michal Marek, Nick Desaulniers, Borislav Petkov,
	Ingo Molnar, Peter Zijlstra

On Fri, Mar 25, 2022 at 6:13 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> +#
> +# Turn off -Werror when extra warnings are enabled
> +#
> +ifneq ($(KBUILD_EXTRA_WARN),)
> +       KBUILD_CFLAGS += -Wno-error
> +endif

NAK.

If you enabled CONFIG_WERROR, then you get CONFIG_WERROR.

If you enabled W=1, then you get extra warnings.

If you enabled both, then you get extra warnings and they are errors.

This patch is just stupid.

              Linus

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/1] Makefile.extrawarn: Turn off -Werror when extra warnings are enabled
  2022-03-25 14:34 ` Masahiro Yamada
  2022-03-25 14:53   ` Andy Shevchenko
@ 2022-03-25 17:20   ` Linus Torvalds
  1 sibling, 0 replies; 7+ messages in thread
From: Linus Torvalds @ 2022-03-25 17:20 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Andy Shevchenko, Linux Kbuild mailing list,
	Linux Kernel Mailing List, Michal Marek, Nick Desaulniers,
	Borislav Petkov, Ingo Molnar, Peter Zijlstra

On Fri, Mar 25, 2022 at 7:35 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
> WERROR should not be enabled for regular builds.

No.

WERROR should be on for regular builds.

It's W=1 that is questionable. It enables warnings that are often
false positives, and if you use W=1 (and particularly W=2) then that's
_your_ problem.

W=1 is most definitely not "regular builds". It's only for people who
want to deal with crazy compiler warnings.

I want WERROR on as widely as possible, because I'm really sick and
tired of developers not noticing when they add warnings because they
did a "regular build"

Stop this idiocy where you think warnings are acceptable.

                Linus

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/1] Makefile.extrawarn: Turn off -Werror when extra warnings are enabled
  2022-03-25 17:18 ` Linus Torvalds
@ 2022-03-25 17:51   ` Andy Shevchenko
  0 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2022-03-25 17:51 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Linux Kbuild mailing list, Linux Kernel Mailing List,
	Masahiro Yamada, Michal Marek, Nick Desaulniers, Borislav Petkov,
	Ingo Molnar, Peter Zijlstra

On Fri, Mar 25, 2022 at 10:18:06AM -0700, Linus Torvalds wrote:
> On Fri, Mar 25, 2022 at 6:13 AM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > +#
> > +# Turn off -Werror when extra warnings are enabled
> > +#
> > +ifneq ($(KBUILD_EXTRA_WARN),)
> > +       KBUILD_CFLAGS += -Wno-error
> > +endif
> 
> NAK.
> 
> If you enabled CONFIG_WERROR, then you get CONFIG_WERROR.
> 
> If you enabled W=1, then you get extra warnings.
> 
> If you enabled both, then you get extra warnings and they are errors.
> 
> This patch is just stupid.

Fair enough.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/1] Makefile.extrawarn: Turn off -Werror when extra warnings are enabled
  2022-03-25 13:13 [PATCH v1 1/1] Makefile.extrawarn: Turn off -Werror when extra warnings are enabled Andy Shevchenko
  2022-03-25 14:34 ` Masahiro Yamada
  2022-03-25 17:18 ` Linus Torvalds
@ 2022-03-25 20:01 ` kernel test robot
  2 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2022-03-25 20:01 UTC (permalink / raw)
  To: Andy Shevchenko, linux-kbuild, linux-kernel
  Cc: llvm, kbuild-all, Masahiro Yamada, Michal Marek,
	Nick Desaulniers, Borislav Petkov, Ingo Molnar, Peter Zijlstra

Hi Andy,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.17 next-20220325]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Andy-Shevchenko/Makefile-extrawarn-Turn-off-Werror-when-extra-warnings-are-enabled/20220325-211517
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 34af78c4e616c359ed428d79fe4758a35d2c5473
config: x86_64-randconfig-a012 (https://download.01.org/0day-ci/archive/20220326/202203260359.nhs6ZZb9-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0f6d9501cf49ce02937099350d08f20c4af86f3d)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/6b5eeef1471c693165f2bdec5fb19c2ba20e9345
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Andy-Shevchenko/Makefile-extrawarn-Turn-off-Werror-when-extra-warnings-are-enabled/20220325-211517
        git checkout 6b5eeef1471c693165f2bdec5fb19c2ba20e9345
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> clang-15: warning: 'x86_64' does not support '-mno-outline-atomics'; flag ignored [-Woption-ignored]

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-03-25 20:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-25 13:13 [PATCH v1 1/1] Makefile.extrawarn: Turn off -Werror when extra warnings are enabled Andy Shevchenko
2022-03-25 14:34 ` Masahiro Yamada
2022-03-25 14:53   ` Andy Shevchenko
2022-03-25 17:20   ` Linus Torvalds
2022-03-25 17:18 ` Linus Torvalds
2022-03-25 17:51   ` Andy Shevchenko
2022-03-25 20:01 ` kernel test robot

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).