clang -Wpointer-sign

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

clang -Wpointer-sign

Mark Kettenis
So clang has this warning turned on by default.  And our codebase is
not clean.  I don't think we intend to fix that anytime soon.  In
fact, I think we deliberately convert between signed and unsigned char
pointers in places.  So I propose to turn this warning off.  Since gcc
recognizes the option we can just unconditionally add -Wno-pointer-sign.

ok?


Index: arch/armv7/conf/Makefile.armv7
===================================================================
RCS file: /cvs/src/sys/arch/armv7/conf/Makefile.armv7,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile.armv7
--- arch/armv7/conf/Makefile.armv7 29 Apr 2016 12:44:52 -0000 1.13
+++ arch/armv7/conf/Makefile.armv7 24 Sep 2016 13:31:55 -0000
@@ -24,7 +24,7 @@ _archdir?= $S/arch/${_arch}
 INCLUDES= -nostdinc -I$S -I. -I$S/arch
 CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP
 CWARNFLAGS= -Werror -Wall -Wimplicit-function-declaration \
- -Wno-main -Wno-uninitialized \
+ -Wno-main -Wno-uninitialized -Wno-pointer-sign \
  -Wframe-larger-than=2047
 
 CMACHFLAGS= -ffreestanding -msoft-float -march=armv6 -Wa,-march=armv7a

Reply | Threaded
Open this post in threaded view
|

Re: clang -Wpointer-sign

Theo de Raadt-2
Please add this to all arch/*/conf/conf/Makefile.* files.

We are trying to minimize differences between these files.  If
that effort isn't made, they will eventually wander far apart from
each other.

> So clang has this warning turned on by default.  And our codebase is
> not clean.  I don't think we intend to fix that anytime soon.  In
> fact, I think we deliberately convert between signed and unsigned char
> pointers in places.  So I propose to turn this warning off.  Since gcc
> recognizes the option we can just unconditionally add -Wno-pointer-sign.
>
> ok?
>
>
> Index: arch/armv7/conf/Makefile.armv7
> ===================================================================
> RCS file: /cvs/src/sys/arch/armv7/conf/Makefile.armv7,v
> retrieving revision 1.13
> diff -u -p -r1.13 Makefile.armv7
> --- arch/armv7/conf/Makefile.armv7 29 Apr 2016 12:44:52 -0000 1.13
> +++ arch/armv7/conf/Makefile.armv7 24 Sep 2016 13:31:55 -0000
> @@ -24,7 +24,7 @@ _archdir?= $S/arch/${_arch}
>  INCLUDES= -nostdinc -I$S -I. -I$S/arch
>  CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D__${_mach}__ -MD -MP
>  CWARNFLAGS= -Werror -Wall -Wimplicit-function-declaration \
> - -Wno-main -Wno-uninitialized \
> + -Wno-main -Wno-uninitialized -Wno-pointer-sign \
>   -Wframe-larger-than=2047
>  
>  CMACHFLAGS= -ffreestanding -msoft-float -march=armv6 -Wa,-march=armv7a
>

Reply | Threaded
Open this post in threaded view
|

Re: clang -Wpointer-sign

Mark Kettenis
> From: "Theo de Raadt" <[hidden email]>
> Date: Sat, 24 Sep 2016 10:44:19 -0600
>
> Please add this to all arch/*/conf/conf/Makefile.* files.
>
> We are trying to minimize differences between these files.  If
> that effort isn't made, they will eventually wander far apart from
> each other.

Sure.  I'll leave luna88k alone though as I don't think gcc3 had a
-Wpointer-sign option.