Since clang 16 (and gcc 11) the default C++ standard is now gnu++17. Because audio/festival's build infrastructure does not explicitly set its C++ standard, this leads to an error: regexp.cc:178:22: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister] STATIC char *regnext(register char *p); ^~~~~~~~~ To work around the error, define the register keyword away using CXXFLAGS.
Created attachment 242794 [details] audio/festival: fix build with clang 16
Maybe, if we're manipulating CXXFLAGS anyway, add an explicit -std=gnu++11 instead? If only because we don't know, what else might be broken (subtly) by the switch to 17?
^Triage: reporter is committer, assign accordingly. LGTM. Builds fine with current LLVM_DEFAULT and with llvm=16. Tested in 12.4{amd64,i386} and -current amd64. I also removed -Dregister= and added -std=gnu11 and builds fine in all production releases too (plus -current).
(In reply to Fernando Apesteguía from comment #3) Yeah that is also a fine solution. I'll check if the program respects USE_CXXSTD, since that is a more standardized method.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=9a521a21bc60d34292ce87e3099f52ec9232d022 commit 9a521a21bc60d34292ce87e3099f52ec9232d022 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2023-06-15 16:31:34 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2023-06-16 18:03:01 +0000 audio/festival: fix build with clang 16 Since clang 16 (and gcc 11) the default C++ standard is now gnu++17. Because audio/festival's build infrastructure does not explicitly set its C++ standard, this leads to an error: regexp.cc:178:22: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister] STATIC char *regnext(register char *p); ^~~~~~~~~ To work around the error, add USE_CXXSTD=gnu++11 to compile for C++11 with GNU extensions instead. While here, pet portlint a little. PR: 272014 Approved by: fernape MFH: 2023Q2 audio/festival/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)