Bug 271031 - textproc/html2text: fix build with clang 16
Summary: textproc/html2text: 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 Only Me
Assignee: Baptiste Daroussin
URL:
Keywords:
Depends on:
Blocks: 271047
  Show dependency treegraph
 
Reported: 2023-04-23 19:14 UTC by Dimitry Andric
Modified: 2023-05-07 18:40 UTC (History)
1 user (show)

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


Attachments
textproc/html2text: fix build with clang 16 (1.48 KB, patch)
2023-04-23 19:14 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-23 19:14:06 UTC
Since clang 16 (and gcc 11) the default C++ standard is now gnu++17.
Because textproc/html2text's Makefile does not explicitly set its C++
standard, this leads to several errors:

  /usr/local/lib/bison.cc:429:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    register int yystate;
    ^~~~~~~~~
  /usr/local/lib/bison.cc:430:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    register int yyn;
    ^~~~~~~~~
  /usr/local/lib/bison.cc:431:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    register short *yyssp;
    ^~~~~~~~~
  /usr/local/lib/bison.cc:432:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    register YY_HTMLParser_STYPE *yyvsp;
    ^~~~~~~~~

Add USE_CXXSTD=gnu++98 to avoid these errors.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-04-23 19:14:31 UTC
Created attachment 241682 [details]
textproc/html2text: fix build with clang 16
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-05-07 18:40:14 UTC
A commit in branch main references this bug:

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

commit 9d2bf7ac7fa5d5cfb5a1aea086de8ba40e773f8c
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-04-23 19:07:29 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-05-07 18:38:47 +0000

    textproc/html2text: fix build with clang 16

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

      /usr/local/lib/bison.cc:429:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
        register int yystate;
        ^~~~~~~~~
      /usr/local/lib/bison.cc:430:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
        register int yyn;
        ^~~~~~~~~
      /usr/local/lib/bison.cc:431:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
        register short *yyssp;
        ^~~~~~~~~
      /usr/local/lib/bison.cc:432:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
        register YY_HTMLParser_STYPE *yyvsp;
        ^~~~~~~~~

    Add USE_CXXSTD=gnu++98 to avoid these errors.

    PR:             271031
    Approved by:    maintainer timeout (2 weeks)
    MFH:            2023Q2

 textproc/html2text/Makefile | 2 ++
 1 file changed, 2 insertions(+)