workflows.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* __diag_ignore_all(), GCC < 8, extra warnings, and -Werror
@ 2023-07-05  9:54 Jani Nikula
  0 siblings, 0 replies; only message in thread
From: Jani Nikula @ 2023-07-05  9:54 UTC (permalink / raw)
  To: linux-kernel, workflows, linux-kbuild, intel-gfx
  Cc: Linus Torvalds, Rodrigo Vivi, Tvrtko Ursulin, Joonas Lahtinen,
	Masahiro Yamada


For a long time now, i915 has enabled a bunch of W=1 style warnings
locally, and we try hard to keep i915 warning free.

One of the warnings is -Woverride-init from -Wextra. We need to bypass
that in a few cases, and used to do this for the relevant files:

	CFLAGS_file.o = $(call cc-disable-warning, override-init)

Recently, we switched from the above to a more localized version in each
file.c:

	__diag_push();
	__diag_ignore_all("-Woverride-init", "Allow overriding inherited members");
	...
        __diag_pop();

We now got a report that this fails the build with CONFIG_WERROR=y or
W=e when using GCC version < 8. Indeed, __diag_ignore_all() requires GCC
version 8 or later.

Should we now revert back to disabling -Woverride-init on a file
granularity? Should we consider breaking the build for CONFIG_WERROR=y
or W=e on older compilers a regression?

I'll note that with the current usage of __diag_ignore_all() elsewhere
in kernel, CONFIG_WERROR=y or W=e with W=1 will never pass on older
compilers. But then again, it has never passed on any compiler, so it
can't be a regression.


BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-07-05  9:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-05  9:54 __diag_ignore_all(), GCC < 8, extra warnings, and -Werror Jani Nikula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox