bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/28882] New: build failure in readelf.c with gcc-4.2 due to


From: mikpelinux at gmail dot com
Subject: [Bug binutils/28882] New: build failure in readelf.c with gcc-4.2 due to use of 0b literals
Date: Fri, 11 Feb 2022 17:48:55 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=28882

            Bug ID: 28882
           Summary: build failure in readelf.c with gcc-4.2 due to use of
                    0b literals
           Product: binutils
           Version: 2.38
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: mikpelinux at gmail dot com
  Target Milestone: ---

Attempting to build binutils-2.38 with gcc-4.2 or older fails with:

/tmp/binutils-2.38/binutils/readelf.c:4239:37: error: invalid suffix "b11" on
integer constant
/tmp/binutils-2.38/binutils/readelf.c:4239:37: error: invalid suffix "b11" on
integer constant
/tmp/binutils-2.38/binutils/readelf.c:4241:43: error: invalid suffix "b11" on
integer constant
/tmp/binutils-2.38/binutils/readelf.c:4241:43: error: invalid suffix "b01" on
integer constant
/tmp/binutils-2.38/binutils/readelf.c:4244:43: error: invalid suffix "b111100"
on integer constant
/tmp/binutils-2.38/binutils/readelf.c:4244:43: error: invalid suffix "b001100"
on integer constant
/tmp/binutils-2.38/binutils/readelf.c:4246:50: error: invalid suffix "b111100"
on integer constant
/tmp/binutils-2.38/binutils/readelf.c:4246:50: error: invalid suffix "b001000"
on integer constant
/tmp/binutils-2.38/binutils/readelf.c:4248:50: error: invalid suffix "b111100"
on integer constant
/tmp/binutils-2.38/binutils/readelf.c:4248:50: error: invalid suffix "b000000"
on integer constant

Building just that file with gcc-11 -std=c17 -Wpedantic shows:

/tmp/binutils-2.38/binutils/readelf.c: In function 'get_machine_flags':
/tmp/binutils-2.38/binutils/readelf.c:4239:27: warning: binary constants are a
C2X feature or GCC extension
 4239 |           if (EF_LOONGARCH_IS_LP64 (e_flags))
      |                           ^~~~
...

So the issue comes from include/elf/loongarch.h's use of 0b literals which are
a GNU C extension since gcc-4.3 but are not in any ANSI or ISO C standard.

I can work around this issue, but the question is whether GNU binutils wants to
require host compiler support for this non-standard feature or not?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]