Bug 248995

Summary: devel/avarice: current llvm 11.0.0 fallout
Product: Ports & Packages Reporter: Craig Leres <leres>
Component: Individual Port(s)Assignee: Joerg Wunsch <joerg>
Status: Closed FIXED    
Severity: Affects Only Me Keywords: patch
Priority: --- Flags: bugzilla: maintainer-feedback? (joerg)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch leres: maintainer-approval?

Description Craig Leres freebsd_committer freebsd_triage 2020-08-29 20:19:01 UTC
Building on FreeBSD 13.0-CURRENT (r364847) produces two fatal errors:

    --- 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 initialization of the wrong field. These look like straight up bugs to me that the newer compiler with better warning detects.

I also filed an upstream bug report:

    https://sourceforge.net/p/avarice/bugs/28/
Comment 1 Craig Leres freebsd_committer freebsd_triage 2020-08-29 20:19:27 UTC
Created attachment 217623 [details]
patch
Comment 2 Joerg Wunsch freebsd_committer freebsd_triage 2020-08-31 05:32:53 UTC
Going to roll a new AVaRICE release - it's long overdue anyway.
Comment 3 commit-hook freebsd_committer freebsd_triage 2020-09-05 21:43:58 UTC
A commit references this bug:

Author: joerg
Date: Sat Sep  5 21:43:21 UTC 2020
New revision: 547759
URL: https://svnweb.freebsd.org/changeset/ports/547759

Log:
  Update AVaRICE port to 2.14

  Among others, this fixes the breakage reported in PR 248995.

  PR:		248995

Changes:
  head/devel/avarice/Makefile
  head/devel/avarice/distinfo
  head/devel/avarice/files/
Comment 4 Joerg Wunsch freebsd_committer freebsd_triage 2020-09-05 21:44:56 UTC
Upgraded the port to AVaRICE 2.14 in r547759.

Thanks for taking the time to analyze the compile error anyway, but pushing the upstream files forward seemed to be the much better solution to me.