diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2022-03-25 11:21:33 -0300 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2024-12-22 17:24:16 +0800 |
commit | 46a813466e2da1d1e1857ff0fb41ae0814614e46 (patch) | |
tree | a7ee6d8f7df89c1e1f70032e184a702119ff8b87 | |
parent | 8d25b9f2c82d45def99e3c7538dcd87c909aae8b (diff) | |
download | glibc-46a813466e2da1d1e1857ff0fb41ae0814614e46.zip glibc-46a813466e2da1d1e1857ff0fb41ae0814614e46.tar.gz glibc-46a813466e2da1d1e1857ff0fb41ae0814614e46.tar.bz2 |
elf: Suppress clang warning on tst-unique4
clang warns that the instantiation of the variable is required,
but no definition is available. They are implemented on
tst-unique4lib.so.
Checked on x86_64-linux-gnu.
Reviewed-by: Sam James <sam@gentoo.org>
-rw-r--r-- | elf/tst-unique4.cc | 6 | ||||
-rw-r--r-- | elf/tst-unique4lib.cc | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/elf/tst-unique4.cc b/elf/tst-unique4.cc index 575c70d..46a42f1 100644 --- a/elf/tst-unique4.cc +++ b/elf/tst-unique4.cc @@ -2,7 +2,12 @@ #include "tst-unique4.h" #include <cstdio> +#include <libc-diag.h> +/* clang warns that the instantiation of the variable is required, but no + definition is available. They are implemented on tst-unique4lib.so. */ +DIAG_PUSH_NEEDS_COMMENT_CLANG; +DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wundefined-var-template"); static int a[24] = { S<1>::i, S<2>::i, S<3>::i, S<4>::i, S<5>::i, S<6>::i, S<7>::i, S<8>::i, @@ -10,6 +15,7 @@ static int a[24] = S<16>::i, S<17>::i, S<18>::i, S<19>::i, S<20>::i, S<21>::i, S<22>::i, S<23>::i, S<24>::i }; +DIAG_POP_NEEDS_COMMENT_CLANG; int main (void) diff --git a/elf/tst-unique4lib.cc b/elf/tst-unique4lib.cc index 17a7cdf..2829e75 100644 --- a/elf/tst-unique4lib.cc +++ b/elf/tst-unique4lib.cc @@ -2,7 +2,7 @@ #include "tst-unique4.h" template<int N> -int S<N>::i = N; +int S<N>::i __attribute__ ((used)) = N; template<int N> const int S<N>::j __attribute__ ((used)) = -1; |