diff options
author | Aiden Grossman <39388941+boomanaiden154@users.noreply.github.com> | 2023-07-26 07:29:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-26 16:29:37 +0200 |
commit | cc0ac7093b8495adc4b5678e41b18601b50d58b2 (patch) | |
tree | 34f352ce511b8afd7109232be2b420888a2efdaf /var | |
parent | 711d67090a5cc49b82e0c0c451bb12f30fc6188e (diff) | |
download | spack-cc0ac7093b8495adc4b5678e41b18601b50d58b2.tar.gz spack-cc0ac7093b8495adc4b5678e41b18601b50d58b2.tar.bz2 spack-cc0ac7093b8495adc4b5678e41b18601b50d58b2.tar.xz spack-cc0ac7093b8495adc4b5678e41b18601b50d58b2.zip |
hdf: fix build with clang16+ (#38888)
With the release of clang 16, clang now treats implicit function
declarations and implicit integers as errors rather than warnings,
causing the build to fail. This patch adds flags to prevent build
failures.
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/hdf/package.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/var/spack/repos/builtin/packages/hdf/package.py b/var/spack/repos/builtin/packages/hdf/package.py index d087ea05ec..ab929bed60 100644 --- a/var/spack/repos/builtin/packages/hdf/package.py +++ b/var/spack/repos/builtin/packages/hdf/package.py @@ -144,6 +144,14 @@ class Hdf(AutotoolsPackage): elif name == "fflags": flags.append(self.compiler.f77_pic_flag) + if name == "cflags": + # https://forum.hdfgroup.org/t/help-building-hdf4-with-clang-error-implicit-declaration-of-function-test-mgr-szip-is-invalid-in-c99/7680 + if self.spec.satisfies("@:4.2.15 %apple-clang") or self.spec.satisfies("%clang@16:"): + flags.append("-Wno-error=implicit-function-declaration") + + if self.spec.satisfies("%clang@16:"): + flags.append("-Wno-error=implicit-int") + return flags, None, None def configure_args(self): @@ -178,10 +186,6 @@ class Hdf(AutotoolsPackage): ["FFLAGS=-fallow-argument-mismatch", "FCFLAGS=-fallow-argument-mismatch"] ) - # https://forum.hdfgroup.org/t/help-building-hdf4-with-clang-error-implicit-declaration-of-function-test-mgr-szip-is-invalid-in-c99/7680 - if self.spec.satisfies("@:4.2.15 %apple-clang"): - config_args.append("CFLAGS=-Wno-error=implicit-function-declaration") - return config_args # Otherwise, we randomly get: |