Bug 271415 - net/norm: fix build with clang 16
Summary: net/norm: 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: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks: 271047
  Show dependency treegraph
 
Reported: 2023-05-14 15:10 UTC by Dimitry Andric
Modified: 2023-05-18 11:38 UTC (History)
4 users (show)

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


Attachments
net/norm: fix build with clang 16 (1.57 KB, patch)
2023-05-14 15:11 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-05-14 15:10:44 UTC
Since clang 16 (and gcc 11) the default C++ standard is now gnu++17.
Because net/norm's build system does not explicitly set the C++
standard, this leads to several errors:

  ../src/common/normEncoderRS8.cpp:264:5: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
      USE_GF_MULC ;
      ^
  ../src/common/normEncoderRS8.cpp:136:21: note: expanded from macro 'USE_GF_MULC'
  #define USE_GF_MULC register gf * __gf_mulc_
                      ^
  ../src/common/normEncoderRS8.cpp:265:5: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
      register gf* dst = dst1;
      ^~~~~~~~~
  ../src/common/normEncoderRS8.cpp:266:5: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
      register gf* src = src1 ;
      ^~~~~~~~~

Add USE_CXXSTD=gnu++98 to compile for C++98 with GNU extensions instead,
as net/norm does not seem to use any C++11 or later constructs.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-05-14 15:11:12 UTC
Created attachment 242169 [details]
net/norm: fix build with clang 16
Comment 2 Mina Galić freebsd_triage 2023-05-14 15:31:30 UTC
might be worth submitting upstream https://github.com/USNavalResearchLaboratory/norm
Comment 3 Dimitry Andric freebsd_committer freebsd_triage 2023-05-14 17:22:52 UTC
(In reply to Mina Galić from comment #2)
Upstream already fixed this a while ago, as part of https://github.com/USNavalResearchLaboratory/norm/commit/88e600ce, but that change has a lot of other stuff which may be unwanted.
Comment 4 Robert Clausecker freebsd_committer freebsd_triage 2023-05-16 11:03:56 UTC
This falls under the build fix blanket.  No maintainer approval is needed, you can commit it yourself, dim@.
Comment 5 commit-hook freebsd_committer freebsd_triage 2023-05-16 18:36:39 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0fb51ef88cf03579745135004621570a58998dfe

commit 0fb51ef88cf03579745135004621570a58998dfe
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-05-14 15:06:42 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-05-16 18:22:56 +0000

    net/norm: fix build with clang 16

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

      ../src/common/normEncoderRS8.cpp:264:5: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
          USE_GF_MULC ;
          ^
      ../src/common/normEncoderRS8.cpp:136:21: note: expanded from macro 'USE_GF_MULC'
      #define USE_GF_MULC register gf * __gf_mulc_
                          ^
      ../src/common/normEncoderRS8.cpp:265:5: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
          register gf* dst = dst1;
          ^~~~~~~~~
      ../src/common/normEncoderRS8.cpp:266:5: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
          register gf* src = src1 ;
          ^~~~~~~~~

    Add USE_CXXSTD=gnu++98 to compile for C++98 with GNU extensions instead,
    as net/norm does not seem to use any C++11 or later constructs.

    PR:             271415
    Approved by:    portmgr (build fix blanket)
    MFH:            2023Q2

 net/norm/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)