linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] trivial: Fix several compilation errors/warnings with GCC12
@ 2022-04-14 15:08 Christophe de Dinechin
  2022-04-14 15:08 ` [PATCH 1/3] sched/headers: Fix compilation error with GCC 12 Christophe de Dinechin
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Christophe de Dinechin @ 2022-04-14 15:08 UTC (permalink / raw)
  To: trivial
  Cc: Ben Segall, Michael S. Tsirkin, Andrew Morton, Steven Rostedt,
	Ingo Molnar, Mel Gorman, Dietmar Eggemann, Vincent Guittot,
	Paolo Bonzini, Daniel Bristot de Oliveira, Jason Wang,
	virtualization, linux-kernel, Zhen Lei, Christophe de Dinechin,
	Juri Lelli, Peter Zijlstra

Compiling with GCC 12 using defconfig generates a number of build errors\r
due to new warnings, notably array-bounds checks. Some of these warnings appear\r
legitimate and relatively easy to fix.\r
\r
Note that this series is not sufficient for a clean build yet. There are\r
in particular a number of warnings reported by the array-bounds check\r
that appear bogus, like:\r
\r
| In function ‘__native_read_cr3’,\r
|     inlined from ‘__read_cr3’\r
|         at ./arch/x86/include/asm/special_insns.h:169:9,\r
|     inlined from ‘read_cr3_pa’\r
|         at ./arch/x86/include/asm/processor.h:252:9,\r
|     inlined from ‘relocate_restore_code’\r
|         at arch/x86/power/hibernate.c:165:17:\r
| ./arch/x86/include/asm/special_insns.h:48:9: error:\r
|    array subscript 0 is outside array bounds of ‘unsigned int[0]’\r
|    [-Werror=array-bounds]\r
|    48 | asm volatile("mov %%cr3,%0\n\t" : "=r" (val) : __FORCE_ORDER);\r
|       | ^~~\r
| cc1: all warnings being treated as errors\r
\r
The error above is for an instruction that does not obviously address any\r
C array, in particular since the asm constraint is "=r" and not "=rm".\r
\r
Consequently, the series here only addresses a few low hanging fruits that\r
appear legitimate and relatively easy to fix.\r
\r
Christophe de Dinechin (3):\r
  sched/headers: Fix compilation error with GCC 12\r
  nodemask.h: Fix compilation error with GCC12\r
  virtio-pci: Use cpumask_available to fix compilation error\r
\r
 drivers/virtio/virtio_pci_common.c |  2 +-\r
 include/linux/nodemask.h           | 13 ++++++-------\r
 kernel/sched/sched.h               | 11 +++++++++--\r
 3 files changed, 16 insertions(+), 10 deletions(-)\r
\r
-- \r
2.35.1\r
\r


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

end of thread, other threads:[~2022-05-19 11:16 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-14 15:08 [PATCH 0/3] trivial: Fix several compilation errors/warnings with GCC12 Christophe de Dinechin
2022-04-14 15:08 ` [PATCH 1/3] sched/headers: Fix compilation error with GCC 12 Christophe de Dinechin
2022-04-14 15:21   ` Peter Zijlstra
2022-04-14 20:30     ` Andrew Morton
2022-04-17 15:52       ` Peter Zijlstra
2022-04-20 18:45         ` Kees Cook
2022-04-21  7:32           ` Peter Zijlstra
2022-04-25 14:23       ` Christophe de Dinechin
2022-04-17 13:27     ` David Laight
2022-04-25 14:07     ` Christophe de Dinechin
2022-05-19 11:16       ` Peter Zijlstra
2022-04-14 15:08 ` [PATCH 2/3] nodemask.h: Fix compilation error with GCC12 Christophe de Dinechin
2022-04-14 15:23   ` Peter Zijlstra
2022-04-14 15:08 ` [PATCH 3/3] virtio-pci: Use cpumask_available to fix compilation error Christophe de Dinechin
2022-04-15  8:48   ` Michael S. Tsirkin
2022-04-28  9:48     ` Christophe Marie Francois Dupont de Dinechin
2022-04-28 11:06       ` Michael S. Tsirkin
2022-05-15 21:24 ` [PATCH 0/3] trivial: Fix several compilation errors/warnings with GCC12 Davidlohr Bueso

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