On Sat, Mar 31, 2018 at 10:57:38PM +0200, Mark Kettenis wrote:
> I'm not sure about the obstack.h bit; why does it complain about
> __INT_TO_PTR but not about __PTR_TO_INT?

So, I think what the code in question is trying to do is convert a ptr
to a a different type while keeping the same "number" in memory.  It's
just a way so they can convert something to an integer to add/remove
values from.  And then it's converted back to a pointer type.

> Maybe we should just disable the warning in question for this crufty
> code?  

But this might be a lot easier actually.  Following diff works for me.
Does this still compile with LLVM 5.0.1?  I have no machine to test
at the moment.

Patrick

diff --git a/gnu/usr.bin/binutils-2.17/gas/configure 
b/gnu/usr.bin/binutils-2.17/gas/configure
index dca6497031c..39ce1f28621 100755
--- a/gnu/usr.bin/binutils-2.17/gas/configure
+++ b/gnu/usr.bin/binutils-2.17/gas/configure
@@ -4180,6 +4180,7 @@ using_cgen=no
 
 
 GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
+GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-null-pointer-arithmetic"
 
 # Check whether --enable-werror or --disable-werror was given.
 if test "${enable_werror+set}" = set; then
diff --git a/gnu/usr.bin/binutils-2.17/ld/configure 
b/gnu/usr.bin/binutils-2.17/ld/configure
index 0cd6f5c99d1..610b6a6caaa 100755
--- a/gnu/usr.bin/binutils-2.17/ld/configure
+++ b/gnu/usr.bin/binutils-2.17/ld/configure
@@ -4229,6 +4229,7 @@ fi;
 
 
 GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
+GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-null-pointer-arithmetic"
 
 # Check whether --enable-werror or --disable-werror was given.
 if test "${enable_werror+set}" = set; then

Reply via email to