Bug 272101 - math/cbc: fix build with clang 16
Summary: math/cbc: fix build with clang 16
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dimitry Andric
URL:
Keywords:
Depends on:
Blocks: 271047
  Show dependency treegraph
 
Reported: 2023-06-20 18:56 UTC by Dimitry Andric
Modified: 2023-06-21 18:31 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (yuri)


Attachments
math/cbc: fix build with clang 16 (1.23 KB, patch)
2023-06-20 18:56 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2023-06-20 18:56:06 UTC
Since clang 16 (and gcc 11) the default C++ standard is now gnu++17.
Because math/cbc's build infrastructure does not explicitly set its C++
standard, this leads to errors:

  ./CbcSymmetry.hpp:83:30: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
      inline void color_vertex(register int k) { color = k; }
                               ^~~~~~~~~
  ./CbcSymmetry.hpp:91:24: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
      inline void bounds(register double a, register double b)
                         ^~~~~~~~~

To work around the error, add USE_CXXSTD=gnu++11 to compile for C++11
with GNU extensions instead.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-06-20 18:56:31 UTC
Created attachment 242894 [details]
math/cbc: fix build with clang 16
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2023-06-20 20:45:29 UTC
Thanks for the patch!
Approved.
Please commit it.
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-06-21 18:28:54 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=22c4f7a75ed3de4b97368be49f1ab70ab0aabb27

commit 22c4f7a75ed3de4b97368be49f1ab70ab0aabb27
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-06-20 18:52:55 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-06-21 18:25:37 +0000

    math/cbc: fix build with clang 16

    Since clang 16 (and gcc 11) the default C++ standard is now gnu++17.
    Because math/cbc's build infrastructure does not explicitly set its C++
    standard, this leads to errors:

      ./CbcSymmetry.hpp:83:30: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
          inline void color_vertex(register int k) { color = k; }
                                   ^~~~~~~~~
      ./CbcSymmetry.hpp:91:24: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
          inline void bounds(register double a, register double b)
                             ^~~~~~~~~

    To work around the error, add USE_CXXSTD=gnu++11 to compile for C++11
    with GNU extensions instead.

    PR:             272101
    Approved by:    yuri (maintainer)
    MFH:            2023Q2

 math/cbc/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)