Since clang 16 (and gcc 11) the default C++ standard is now gnu++17. Because devel/gperf's Makefile does not explicitly set its C++ standard, this leads to an error: c++ -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -I. -c ./getline.cc ./getline.cc:58:7: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister] register int c = getc (stream); ^~~~~~~~~ Add USE_CXXSTD=gnu++89 to avoid this error.
Created attachment 241681 [details] devel/gperf: fix build with clang 16
I will look into it. any reason you prefer gnu++89 instead of a newer variant?
Actually this was a typo, it's gnu++98 :) Looking at the code itself, it is definitely not c++11 or anything like that. It looks mostly like C++ how it was quite a while before it. Until recently I think the defaults for clang++ and g++ have been gnu++14, so that would probably also work, but with a lot of additional warnings.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=984b20be70ad5b3814c1580bc82de57e3ed90f61 commit 984b20be70ad5b3814c1580bc82de57e3ed90f61 Author: Dirk Meyer <dinoex@FreeBSD.org> AuthorDate: 2023-05-02 17:11:26 +0000 Commit: Dirk Meyer <dinoex@FreeBSD.org> CommitDate: 2023-05-02 17:11:26 +0000 devel/gperf: fix build with clang 16 PR: 271030 devel/gperf/Makefile | 2 ++ 1 file changed, 2 insertions(+)