Bug 271044 - textproc/source-highlight: fix build with clang 16
Summary: textproc/source-highlight: 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: Tobias C. Berner
URL:
Keywords:
Depends on:
Blocks: 271047
  Show dependency treegraph
 
Reported: 2023-04-24 15:29 UTC by Dimitry Andric
Modified: 2023-04-29 08:57 UTC (History)
1 user (show)

See Also:
tcberner: maintainer-feedback+


Attachments
textproc/source-highlight: fix build with clang 16 (2.09 KB, patch)
2023-04-24 15:30 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-04-24 15:29:41 UTC
Since clang 16 (and gcc 11) the default C++ standard is now gnu++17.
Because textproc/source-highlight's Makefile does not explicitly set its C++
standard, this leads to several errors:

  In file included from fileutil.cc:28:
  ./fileutil.h:30:41: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
  string readFile(const string &fileName) throw (IOException);
                                          ^~~~~~~~~~~~~~~~~~~
  ./fileutil.h:30:41: note: use 'noexcept(false)' instead
  string readFile(const string &fileName) throw (IOException);
                                          ^~~~~~~~~~~~~~~~~~~
                                          noexcept(false)
  fileutil.cc:51:41: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
  string readFile(const string &fileName) throw (IOException) {
                                          ^~~~~~~~~~~~~~~~~~~
  fileutil.cc:51:41: note: use 'noexcept(false)' instead
  string readFile(const string &fileName) throw (IOException) {
                                          ^~~~~~~~~~~~~~~~~~~
                                          noexcept(false)

In http://git.savannah.gnu.org/cgit/src-highlite.git/commit/?id=416b397
indicates that after 3.1.9 C++11 will be required and supported, so add
USE_CXXSTD=gnu++11 to avoid the errors for now.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-04-24 15:30:15 UTC
Created attachment 241699 [details]
textproc/source-highlight: fix build with clang 16
Comment 2 Tobias C. Berner freebsd_committer freebsd_triage 2023-04-29 04:04:21 UTC
lgtm
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-04-29 08:47:43 UTC
A commit in branch main references this bug:

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

commit 276de0b840925e727810341ed61a0849c9607e52
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-04-24 10:40:06 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-04-29 08:43:16 +0000

    textproc/source-highlight: fix build with clang 16

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

      In file included from fileutil.cc:28:
      ./fileutil.h:30:41: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
      string readFile(const string &fileName) throw (IOException);
                                              ^~~~~~~~~~~~~~~~~~~
      ./fileutil.h:30:41: note: use 'noexcept(false)' instead
      string readFile(const string &fileName) throw (IOException);
                                              ^~~~~~~~~~~~~~~~~~~
                                              noexcept(false)
      fileutil.cc:51:41: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec]
      string readFile(const string &fileName) throw (IOException) {
                                              ^~~~~~~~~~~~~~~~~~~
      fileutil.cc:51:41: note: use 'noexcept(false)' instead
      string readFile(const string &fileName) throw (IOException) {
                                              ^~~~~~~~~~~~~~~~~~~
                                              noexcept(false)

    In http://git.savannah.gnu.org/cgit/src-highlite.git/commit/?id=416b397
    indicates that after 3.1.9 C++11 will be required and supported, so add
    USE_CXXSTD=gnu++11 to avoid the errors for now.

    PR:             271044
    Approved by:    tcberner (maintainer)
    MFH             2023Q2

 textproc/source-highlight/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)