Menu ▾ ▴

#28 Fix build with llvm 11.0.0

v1.0_(example)
closed
None
5
2020-08-29
2020-08-29
Craig Leres
No

Here's a patch that unbreaks building on FreeBSD 13.0-CURRENT (r364847) with llvm 11.0.0:

--- devdescr.o ---
devdescr.cc:2251:2: error: type 'gdb_io_reg_def_type []' cannot be narrowed to 'bool' in initializer list [-Wc++11-narrowing]
        atmega32m1_io_registers,
        ^~~~~~~~~~~~~~~~~~~~~~~
devdescr.cc:2251:2: note: insert an explicit cast to silence this issue
        atmega32m1_io_registers,
        ^~~~~~~~~~~~~~~~~~~~~~~
        static_cast<bool>(     )
devdescr.cc:2375:2: error: type 'gdb_io_reg_def_type []' cannot be narrowed to 'bool' in initializer list [-Wc++11-narrowing]
        atmega32c1_io_registers,
        ^~~~~~~~~~~~~~~~~~~~~~~
devdescr.cc:2375:2: note: insert an explicit cast to silence this issue
        atmega32c1_io_registers,
        ^~~~~~~~~~~~~~~~~~~~~~~
        static_cast<bool>(     )
devdescr.cc:2375:2: warning: address of array 'atmega32c1_io_registers' will always evaluate to 'true' [-Wpointer-bool-conversion]
        atmega32c1_io_registers,
        ^~~~~~~~~~~~~~~~~~~~~~~
devdescr.cc:2251:2: warning: address of array 'atmega32m1_io_registers' will always evaluate to 'true' [-Wpointer-bool-conversion]
        atmega32m1_io_registers,
        ^~~~~~~~~~~~~~~~~~~~~~~
2 warnings and 2 errors generated.

The problem appears to be two instances of static initialzation of the wrong field. These look like straight up bugs to me that the newer compiler with better warning detects.

1 Attachments

Discussion

  • Joerg Wunsch

    Joerg Wunsch - 2020-08-29

    Actually, this bug has been fixed long ago in the tree, as part of merging the EDBG changes.
    So seems it's really high time to finally roll a new release, even though I'm not fully happy wit hthe stability of EDBG.

     
  • Joerg Wunsch

    Joerg Wunsch - 2020-08-29
    • status: open --> closed
    • assigned_to: Joerg Wunsch
     

Log in to post a comment.