Skip to contentSkip to conversation

mips: Disable attribute-alias warnings

PATCH In review Khem Raj 3 participants 3 messages May 4, 2018 – Jun 15, 2018 2 messages not in the archive MIPS

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 mips: Disable attribute-alias warnings

This warning is seen with gcc-8

error: 'sys_cachectl' alias between functions of incompatible types 'long int(char *, int, int)'
and 'long int(long int, long int, long int)'

---
 arch/mips/kernel/Makefile | 2 ++
 arch/mips/mm/Makefile     | 1 +
 2 files changed, 3 insertions(+)
arch/mips/kernel/Makefile +2 -0
index f10e1e15e1c6..eb92e52eb3db 100644
@@ -2,6 +2,8 @@
 #
 # Makefile for the Linux/MIPS kernel.
 #
+CFLAGS_signal.o		+= $(call cc-disable-warning, attribute-alias)
+CFLAGS_syscall.o	+= $(call cc-disable-warning, attribute-alias)
 
 extra-y		:= head.o vmlinux.lds
 
arch/mips/mm/Makefile +1 -0
index c463bdad45c7..b7f9ef80dac7 100644
@@ -2,6 +2,7 @@
 #
 # Makefile for the Linux/MIPS-specific parts of the memory manager.
 #
+CFLAGS_cache.o			+= $(call cc-disable-warning, attribute-alias)
 
 obj-y				+= cache.o dma-default.o extable.o fault.o \
 				   gup.o init.o mmap.o page.o page-funcs.o \
Signature · 1 line
2.17.0

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 41 lines · Khem Raj
Quoted 28 lines · Matt Redfearn

Hi Khem,

Quoted 24 lines · Khem Raj

This warning is seen with gcc-8

error: 'sys_cachectl' alias between functions of incompatible types 'long int(char *, int, int)'
and 'long int(long int, long int, long int)'

---
  arch/mips/kernel/Makefile | 2 ++
  arch/mips/mm/Makefile     | 1 +
  2 files changed, 3 insertions(+)
arch/mips/kernel/Makefile +1 -0
index f10e1e15e1c6..eb92e52eb3db 100644
@@ -2,6 +2,8 @@
  #
  # Makefile for the Linux/MIPS kernel.
  #
+CFLAGS_signal.o        += $(call cc-disable-warning, attribute-alias)
Quoted 9 lines

arch/mips/kernel/Makefile line 6

Quoted 1 line
arch/mips/kernel/Makefile +1 -0
+CFLAGS_syscall.o    += $(call cc-disable-warning, attribute-alias)

Rather than disabling the (potentially useful) warning for the whole compilation unit, the better fix, I believe, would be something like Arnd proposed https://patchwork.kernel.org/patch/10093317/ to disable it just for the definition of the syscall entry point . Whatever happened to that RFC Arnd?

Quoted 3 lines

I tend to agree. I think, I have also tested a patch where I am manually ignoring the warning via pragma around the function which essentially is similar to what Arnd has proposed only that Arnd's patch is generic

Sorry I never followed up on my initial patches. I still think we should do it that way, but will need some more time until I can revisit them, as I'm currently
travelling. If someone else wants to pick up my patches and post a new version in the meantime, that would be greatly appreciated.

Arnd

#4 lore raw

Hi Arnd,

Quoted 8 lines · Arnd Bergmann
Quoted 3 lines

I tend to agree. I think, I have also tested a patch where I am manually ignoring the warning via pragma around the function which essentially is similar to what Arnd has proposed only that Arnd's patch is generic

Sorry I never followed up on my initial patches. I still think we should do it that way, but will need some more time until I can revisit them, as I'm currently travelling. If someone else wants to pick up my patches and post a new version in the meantime, that would be greatly appreciated.

If you're still away then I'll aim to do this tomorrow - I see PowerPC has already merged local #pragma's & we've had 2 submissions now for the MIPS equivalent, so it'd be good to get this solved generically.

Thanks,
Paul