Page MenuHomeFreeBSD

Fix binutils compilation error with Clang 8

Authored by on Feb 18 2019, 5:03 PM.



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)

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline edited the test plan for this revision. (Show Details)
pfg accepted this revision.Feb 22 2019, 7:17 PM
pfg added a subscriber: pfg.

FWIW, the GPLv3 version does an ugly calloc() dance with pointers which looks a lot more confusing.

This revision is now accepted and ready to land.Feb 22 2019, 7:17 PM
emaste accepted this revision.Feb 27 2019, 5:16 PM
emaste added a subscriber: brooks.

LGTM to me too

brooks accepted this revision.Feb 27 2019, 9:00 PM

This looks right to me.

This revision was automatically updated to reflect the committed changes.