Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gperf: fix build with clang 16 #235120

Merged
merged 1 commit into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkgs/development/tools/misc/gperf/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ stdenv.mkDerivation rec {
sha256 = "1qispg6i508rq8pkajh26cznwimbnj06wq9sd85vg95v8nwld1aq";
};

patches = [
# Clang 16 defaults to C++17, which does not allow `register` as a storage class specifier.
./gperf-c++17-register-fix.patch
];

enableParallelBuilding = true;

meta = {
Expand Down
13 changes: 13 additions & 0 deletions pkgs/development/tools/misc/gperf/gperf-c++17-register-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/lib/getline.cc b/lib/getline.cc
index c57c633..0984a7c 100644
--- a/lib/getline.cc
+++ b/lib/getline.cc
@@ -55,7 +55,7 @@ getstr (char **lineptr, size_t *n, FILE *stream, char terminator, size_t offset)

for (;;)
{
- register int c = getc (stream);
+ int c = getc (stream);

/* We always want at least one char left in the buffer, since we
always (unless we get an error while reading the first char)