From 856834537ae2a4ba0ac12dfe78b0247f8ed8f7bf Mon Sep 17 00:00:00 2001 From: Aiden Grossman <39388941+boomanaiden154@users.noreply.github.com> Date: Wed, 26 Jul 2023 07:34:07 -0700 Subject: gcoff: fix build with clang 16+ (#38914) gcoff uses the register keyword in a couple different places which causes errors when building with c++17, which is the default in clang 16. This patch adds the -Wno-register flag to ignore these errors when when building with clang 16. --- var/spack/repos/builtin/packages/groff/package.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/groff/package.py b/var/spack/repos/builtin/packages/groff/package.py index 132348295a..a2ccd663ec 100644 --- a/var/spack/repos/builtin/packages/groff/package.py +++ b/var/spack/repos/builtin/packages/groff/package.py @@ -88,3 +88,9 @@ class Groff(AutotoolsPackage, GNUMirrorPackage): if self.spec.satisfies("+x"): dir = join_path(self.prefix.lib, "X11", "app-defaults") env.set_path("XFILESEARCHPATH", dir) + + def flag_handler(self, name, flags): + if name == "cxxflags": + if self.spec.satisfies("%clang@16:"): + flags.append("-Wno-register") + return (flags, None, None) -- cgit v1.2.3-60-g2f50