Bug 271851 - textproc/opensp: fix build with clang 16
Summary: textproc/opensp: 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-05 21:03 UTC by Dimitry Andric
Modified: 2023-06-06 17:02 UTC (History)
1 user (show)

See Also:


Attachments
textproc/opensp: fix build with clang 16 (1.04 KB, patch)
2023-06-05 21:04 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-05 21:03:05 UTC
Since clang 16 (and gcc 11) the default C++ standard is now gnu++17.
Because textproc/opensp's build infrastructure does not explicitly set
its C++ standard, this leads to an error:

  Recognizer.cxx:42:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    register const Trie *pos = trie_.pointer();
    ^~~~~~~~~

To work around the error, define the register keyword away using
CPPFLAGS.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-06-05 21:04:14 UTC
Created attachment 242625 [details]
textproc/opensp: fix build with clang 16
Comment 2 Fernando Apesteguía freebsd_committer freebsd_triage 2023-06-06 15:10:28 UTC
^Triage: reporter is committer, assign accordingly.

LGTM
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-06-06 17:01:23 UTC
A commit in branch main references this bug:

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

commit af011365cffd2b76bab3f514de664e803575fb1f
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-06-05 21:00:15 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-06-06 16:58:39 +0000

    textproc/opensp: fix build with clang 16

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

      Recognizer.cxx:42:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
        register const Trie *pos = trie_.pointer();
        ^~~~~~~~~

    To work around the error, define the register keyword away using
    CPPFLAGS.

    PR:             271851
    Approved by:    fernape
    MFH:            2023Q2

 textproc/opensp/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)