Skip to contentSkip to conversation

powerpc: Disable attribute-alias warnings from gcc8

PATCH In review Khem Raj 2 participants 3 messages May 4, 2018 – May 8, 2018 PowerPC

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 powerpc: Disable attribute-alias warnings from gcc8

Fixes
alias between functions of incompatible types warnings which are new with gcc8

Cc Benjamin Herrenschmidt <[email protected]>
---
 arch/powerpc/kernel/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/kernel/Makefile +2 -1
index 2b4c40b255e4..7ac5a68ad6b1 100644
@@ -3,7 +3,8 @@
 # Makefile for the linux kernel.
 #
 
-CFLAGS_ptrace.o		+= -DUTS_MACHINE='"$(UTS_MACHINE)"'
+CFLAGS_ptrace.o		+= -DUTS_MACHINE='"$(UTS_MACHINE)"' $(call cc-disable-warning, attribute-alias)
+CFLAGS_syscalls.o	+= $(call cc-disable-warning, attribute-alias)
 
 subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
 
Signature · 1 line
2.17.0
author
#1 lore raw

PATCH 2/2 powerpc/ptrace: Disable array-bounds warning with gcc8

This masks the new gcc8 warning

regset.h:270:4: error: 'memcpy' offset [-527, -529] is out of the bounds [0, 16] of object 'vrsave' with type 'union <anonymous>'

Cc Benjamin Herrenschmidt <[email protected]>
---
 arch/powerpc/kernel/Makefile | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/kernel/Makefile +1 -0
index 7ac5a68ad6b1..ab159a34704a 100644
@@ -4,6 +4,7 @@
 #
 
 CFLAGS_ptrace.o		+= -DUTS_MACHINE='"$(UTS_MACHINE)"' $(call cc-disable-warning, attribute-alias)
+CFLAGS_ptrace.o		+= $(call cc-disable-warning, array-bounds)
 CFLAGS_syscalls.o	+= $(call cc-disable-warning, attribute-alias)
 
 subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
Signature · 1 line
2.17.0
#2 lore raw

Re: [PATCH 2/2] powerpc/ptrace: Disable array-bounds warning with gcc8

Quoted 4 lines · Khem Raj

This masks the new gcc8 warning

regset.h:270:4: error: 'memcpy' offset [-527, -529] is out of the bounds [0, 16] of object 'vrsave' with type 'union <anonymous>'

Why would we want to mask the warning rather than fix it?

cheers

Quoted 21 lines
Cc Benjamin Herrenschmidt <[email protected]>
---
 arch/powerpc/kernel/Makefile | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/kernel/Makefile +1 -0
index 7ac5a68ad6b1..ab159a34704a 100644
@@ -4,6 +4,7 @@
 #
 
 CFLAGS_ptrace.o		+= -DUTS_MACHINE='"$(UTS_MACHINE)"' $(call cc-disable-warning, attribute-alias)
+CFLAGS_ptrace.o		+= $(call cc-disable-warning, array-bounds)
 CFLAGS_syscalls.o	+= $(call cc-disable-warning, attribute-alias)
 
 subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
Signature · 1 line
2.17.0