bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/24392] New: Cant compile in clang warning Wtautological-co


From: u6759601 at anu dot edu.au
Subject: [Bug binutils/24392] New: Cant compile in clang warning Wtautological-constant-out-of-range-compare
Date: Wed, 27 Mar 2019 16:08:20 +0000

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

            Bug ID: 24392
           Summary: Cant compile in clang warning
                    Wtautological-constant-out-of-range-compare
           Product: binutils
           Version: 2.33 (HEAD)
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: u6759601 at anu dot edu.au
  Target Milestone: ---

I am trying to compile HEAD directly clone from the git with clang like

CC='clang' CXX='clang++' ./configure --prefix=$(pwd)/bin 
make

I am getting the following warning:

/bin/bash ./libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. 
-DBINDIR='"/home/jorpilo/fuzzing/binutils-gdb/bin/bin"' -I. -I. -I./../include 
-DHAVE_x86_64_elf64_vec -DHAVE_i386_elf32_vec -DHAVE_iamcu_elf32_vec
-DHAVE_x86_64_elf32_vec -DHAVE_i386_pei_vec -DHAVE_x86_64_pei_vec
-DHAVE_l1om_elf64_vec -DHAVE_k1om_elf64_vec -DHAVE_elf64_le_vec
-DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec -DHAVE_plugin_vec  
-W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -I./../zlib
-g -O2 -MT elf.lo -MD -MP -MF .deps/elf.Tpo -c -o elf.lo elf.c
libtool: compile:  clang -DHAVE_CONFIG_H -I.
-DBINDIR=\"/home/jorpilo/fuzzing/binutils-gdb/bin/bin\" -I. -I. -I./../include
-DHAVE_x86_64_elf64_vec -DHAVE_i386_elf32_vec -DHAVE_iamcu_elf32_vec
-DHAVE_x86_64_elf32_vec -DHAVE_i386_pei_vec -DHAVE_x86_64_pei_vec
-DHAVE_l1om_elf64_vec -DHAVE_k1om_elf64_vec -DHAVE_elf64_le_vec
-DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec -DHAVE_plugin_vec
-W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -I./../zlib
-g -O2 -MT elf.lo -MD -MP -MF .deps/elf.Tpo -c elf.c -o elf.o

elf.c:8280:26: error: result of comparison of constant 1152921504606846975 with
expression of type 'unsigned int' is always false
[-Werror,-Wtautological-constant-out-of-range-compare]
  if (asect->reloc_count >= LONG_MAX / sizeof (arelent *))
      ~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1 error generated.
make[4]: *** [Makefile:1598: elf.lo] Error 1
make[4]: Leaving directory '/home/jorpilo/fuzzing/binutils-gdb/bfd'
make[3]: *** [Makefile:1641: all-recursive] Error 1
make[3]: Leaving directory '/home/jorpilo/fuzzing/binutils-gdb/bfd'
make[2]: *** [Makefile:1167: all] Error 2
make[2]: Leaving directory '/home/jorpilo/fuzzing/binutils-gdb/bfd'
make[1]: *** [Makefile:2692: all-bfd] Error 2
make[1]: Leaving directory '/home/jorpilo/fuzzing/binutils-gdb'
make: *** [Makefile:850: all] Error 2


Its simply a warning saying that the if is always false (then it should be
avoided). But as -Werror is set in /bfd/Makefile it treat it as an error and it
stops the compilation

To compile it with the warning I had to remove -Werror from WARN_CFLAGS and
WARN_CFLAGS_FOR_BUILD in /bfd/Makefile but I guess the proper solution would be
removing the if at line 8280 of bfd/elf.c as it is always false

-- 
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]