gperf: fix build with clang 16

Clang 16 defaults to C++17, which does not allow the `register` storage
class specifier. This is fixed upstream, but the change doesn’t apply
cleanly to the 3.1 release. Fortunately, the fix is trivial (remove the
disallowed keyword).

+18
+5
pkgs/development/tools/misc/gperf/default.nix
··· 9 sha256 = "1qispg6i508rq8pkajh26cznwimbnj06wq9sd85vg95v8nwld1aq"; 10 }; 11 12 enableParallelBuilding = true; 13 14 meta = {
··· 9 sha256 = "1qispg6i508rq8pkajh26cznwimbnj06wq9sd85vg95v8nwld1aq"; 10 }; 11 12 + patches = [ 13 + # Clang 16 defaults to C++17, which does not allow `register` as a storage class specifier. 14 + ./gperf-c++17-register-fix.patch 15 + ]; 16 + 17 enableParallelBuilding = true; 18 19 meta = {
+13
pkgs/development/tools/misc/gperf/gperf-c++17-register-fix.patch
···
··· 1 + diff --git a/lib/getline.cc b/lib/getline.cc 2 + index c57c633..0984a7c 100644 3 + --- a/lib/getline.cc 4 + +++ b/lib/getline.cc 5 + @@ -55,7 +55,7 @@ getstr (char **lineptr, size_t *n, FILE *stream, char terminator, size_t offset) 6 + 7 + for (;;) 8 + { 9 + - register int c = getc (stream); 10 + + int c = getc (stream); 11 + 12 + /* We always want at least one char left in the buffer, since we 13 + always (unless we get an error while reading the first char)