3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #235120 from reckenrode/gperf-clang-fix

gperf: fix build with clang 16
This commit is contained in:
Sergei Trofimovich 2023-05-31 18:10:29 +01:00 committed by GitHub
commit 421a6f37b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View file

@ -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 = {

View file

@ -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)