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)
Jan 27 2024, 9:43 PM
Unknown Object (File)
Jan 27 2024, 9:37 PM
Unknown Object (File)
Jan 27 2024, 9:37 PM
Unknown Object (File)
Jan 27 2024, 3:32 AM
Unknown Object (File)
Jan 8 2024, 7:44 PM
Unknown Object (File)
Dec 31 2023, 10:19 PM
Unknown Object (File)
Dec 10 2023, 2:31 PM
Unknown Object (File)
Oct 18 2023, 12:14 PM

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.