Page MenuHomeFreeBSD

Fix binutils compilation error with Clang 8
ClosedPublic

Authored by alfredo on Feb 18 2019, 5:03 PM.
Tags
None
Referenced Files
F103094572: D19235.id54044.diff
Wed, Nov 20, 9:50 PM
Unknown Object (File)
Thu, Nov 7, 12:54 PM
Unknown Object (File)
Oct 18 2024, 9:13 AM
Unknown Object (File)
Oct 4 2024, 10:07 PM
Unknown Object (File)
Oct 4 2024, 8:58 PM
Unknown Object (File)
Oct 2 2024, 9:03 AM
Unknown Object (File)
Oct 1 2024, 5:43 AM
Unknown Object (File)
Sep 24 2024, 3:57 AM

Details

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)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

alfredo edited the test plan for this revision. (Show Details)
pfg added a subscriber: pfg.

LGTM.
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 added a subscriber: brooks.

LGTM to me too

This looks right to me.

This revision was automatically updated to reflect the committed changes.