diff options
author | Aiden Grossman <39388941+boomanaiden154@users.noreply.github.com> | 2023-07-18 23:28:57 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-19 08:28:57 +0200 |
commit | b04b3aed9e9fcd4364e5ece81605f5184e69f061 (patch) | |
tree | 358914a475e383d70d097f6362fda60401c813b4 | |
parent | 90b2e402f510d96c41508c70a1e1ffdacfaac762 (diff) | |
download | spack-b04b3aed9e9fcd4364e5ece81605f5184e69f061.tar.gz spack-b04b3aed9e9fcd4364e5ece81605f5184e69f061.tar.bz2 spack-b04b3aed9e9fcd4364e5ece81605f5184e69f061.tar.xz spack-b04b3aed9e9fcd4364e5ece81605f5184e69f061.zip |
gperf: patch usage of register keyword (#38893)
gperf still uses the register keyword in one place which makes
compilation fail with c++17. This patch adds in a patch file to remove
the usage of the reigster keyword so that it compiles properly.
-rw-r--r-- | var/spack/repos/builtin/packages/gperf/package.py | 6 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/gperf/register.patch | 13 |
2 files changed, 19 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/gperf/package.py b/var/spack/repos/builtin/packages/gperf/package.py index 29c9556373..51ddf0f2ea 100644 --- a/var/spack/repos/builtin/packages/gperf/package.py +++ b/var/spack/repos/builtin/packages/gperf/package.py @@ -20,4 +20,10 @@ class Gperf(AutotoolsPackage, GNUMirrorPackage): version("3.1", sha256="588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2") version("3.0.4", sha256="767112a204407e62dbc3106647cf839ed544f3cf5d0f0523aaa2508623aad63e") + # This patch removes all instances of the register keyword within gperf + # which is necessary to build gperf with recent compilers that default to + # c++17 where using the register keyword results in a compile-time error. + # This has no impact on correctness. + patch("register.patch") + # NOTE: `make check` is known to fail tests diff --git a/var/spack/repos/builtin/packages/gperf/register.patch b/var/spack/repos/builtin/packages/gperf/register.patch new file mode 100644 index 0000000000..8af66429eb --- /dev/null +++ b/var/spack/repos/builtin/packages/gperf/register.patch @@ -0,0 +1,13 @@ +diff --git a/lib/getline.cc b/lib/getline.cc +index ecc3e85..2d97644 100644 (file) +--- 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) |