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.
This commit is contained in:
Aiden Grossman 2023-07-26 07:34:07 -07:00 committed by GitHub
parent fba019f0be
commit 856834537a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,3 +88,9 @@ def setup_run_environment(self, env):
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)