Bug 271494 - textproc/jade: fix build with clang 16
Summary: textproc/jade: 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-05-18 15:46 UTC by Dimitry Andric
Modified: 2023-05-18 18:46 UTC (History)
1 user (show)

See Also:
cy: maintainer-feedback+


Attachments
textproc/jade: fix build with clang 16 (999 bytes, patch)
2023-05-18 15:46 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-18 15:46:08 UTC
Since clang 16 (and gcc 11) the default C++ standard is now gnu++17.
Because textproc/jade's Makefile does not explicitly set its C++
standard, this leads to an error:

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

Add USE_CXXSTD=gnu++98 to compile for C++98 with GNU extensions instead.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-05-18 15:46:39 UTC
Created attachment 242254 [details]
textproc/jade: fix build with clang 16
Comment 2 Cy Schubert freebsd_committer freebsd_triage 2023-05-18 15:50:02 UTC
Approved. Commit at your convenience.
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-05-18 18:31:08 UTC
A commit in branch main references this bug:

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

commit 38f54301414a3f446ff99de936c985672ff8e8c8
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-05-18 15:43:15 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-05-18 18:21:48 +0000

    textproc/jade: fix build with clang 16

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

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

    Add USE_CXXSTD=gnu++98 to compile for C++98 with GNU extensions instead.

    PR:             271494
    Approved by:    cy (maintainer)
    MFH:            2023Q2

 textproc/jade/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 4 Dimitry Andric freebsd_committer freebsd_triage 2023-05-18 18:39:01 UTC
That was quick, thanks!
Comment 5 Cy Schubert freebsd_committer freebsd_triage 2023-05-18 18:46:46 UTC
NP. It looked good. You did all the work. No sense standing in your way, especially since everyone has a lot of work to do.