svn commit: r344791 - head/contrib/binutils/opcodes

Justin Hibbits jhibbits at FreeBSD.org
Tue Mar 5 04:16:51 UTC 2019


Author: jhibbits
Date: Tue Mar  5 04:16:50 2019
New Revision: 344791
URL: https://svnweb.freebsd.org/changeset/base/344791

Log:
  Fix binutils compilation error with Clang 8
  
  Summary:
  This change fixes the following compilation error when using clang 8 to cross
  compile base to powerpc64:
  
  ```
  /usr/src/gnu/usr.bin/binutils/libopcodes/../../../../contrib/binutils/opcodes/ppc-dis.c:100:35:
  error: arithmetic on a null pointer treated as a cast from integer to pointer is
  a GNU extension [-Werror,-Wnull-pointer-arithmetic]
    info->private_data = (char *) 0 + dialect;
  		       ~~~~~~~~~~ ^
  1 error generated.
  *** [ppc-dis.o] Error code 1
  
  make[6]: stopped in /usr/src/gnu/usr.bin/binutils/libopcodes
  1 error
  ```
  
  Test Plan:
  - buildworld for x86_64 (native)
  - buildworld for powerpc64 (cross)
  - buildworld for powerpc64 (native)
  
  Submitted by:	alfredo.junior_eldorado.org.br
  Reviewed By:	emaste, pfg, brooks
  Differential Revision:	https://reviews.freebsd.org/D19235

Modified:
  head/contrib/binutils/opcodes/ppc-dis.c

Modified: head/contrib/binutils/opcodes/ppc-dis.c
==============================================================================
--- head/contrib/binutils/opcodes/ppc-dis.c	Tue Mar  5 04:15:34 2019	(r344790)
+++ head/contrib/binutils/opcodes/ppc-dis.c	Tue Mar  5 04:16:50 2019	(r344791)
@@ -20,6 +20,7 @@ along with this file; see the file COPYING.  If not, w
 Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #include <stdio.h>
+#include <inttypes.h>
 #include "sysdep.h"
 #include "dis-asm.h"
 #include "opcode/ppc.h"
@@ -97,7 +98,7 @@ powerpc_dialect (struct disassemble_info *info)
 	dialect |= PPC_OPCODE_64;
     }
 
-  info->private_data = (char *) 0 + dialect;
+  info->private_data = (void *)(uintptr_t)dialect;
   return dialect;
 }
 


More information about the svn-src-all mailing list