Page MenuHomeFreeBSD

Fix binutils compilation error with Clang 8
ClosedPublic

Authored by alfredo on Feb 18 2019, 5:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 2, 12:30 AM
Unknown Object (File)
Sat, Sep 20, 3:45 AM
Unknown Object (File)
Sep 6 2025, 9:52 AM
Unknown Object (File)
Sep 5 2025, 11:01 AM
Unknown Object (File)
Jul 26 2025, 1:11 AM
Unknown Object (File)
Jul 11 2025, 8:07 AM
Unknown Object (File)
Jun 22 2025, 7:48 AM
Unknown Object (File)
Jun 20 2025, 8:37 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.