public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] elf: Suppress clang warning on tst-unique4 Date: Thu, 9 Jun 2022 21:23:35 +0000 (GMT) [thread overview] Message-ID: <20220609212335.03BF23850236@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f4655549a41e6bba31eac239a9692a0ef60aa89b commit f4655549a41e6bba31eac239a9692a0ef60aa89b Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Fri Mar 25 11:21:33 2022 -0300 elf: Suppress clang warning on tst-unique4 clang warns that the instatiation of the variable is required, but no definition is available. They are implemented on tst-unique4lib.so. Checked on x86_64-linux-gnu. Diff: --- elf/tst-unique4.cc | 6 ++++++ elf/tst-unique4lib.cc | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/elf/tst-unique4.cc b/elf/tst-unique4.cc index 575c70d3a1..ab727b8dbb 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 instatiation 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 17a7cdf567..2829e75cee 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;
next reply other threads:[~2022-06-09 21:23 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-06-09 21:23 Adhemerval Zanella [this message] -- strict thread matches above, loose matches on Subject: below -- 2024-04-17 20:11 Adhemerval Zanella 2024-04-02 15:57 Adhemerval Zanella 2024-02-09 17:35 Adhemerval Zanella 2024-02-07 14:10 Adhemerval Zanella 2024-01-29 18:01 Adhemerval Zanella 2023-12-21 18:57 Adhemerval Zanella 2023-09-28 17:55 Adhemerval Zanella 2023-08-30 12:40 Adhemerval Zanella 2023-02-09 19:52 Adhemerval Zanella 2022-10-28 17:45 Adhemerval Zanella 2022-10-04 13:03 Adhemerval Zanella 2022-06-09 13:20 Adhemerval Zanella 2022-06-03 14:09 Adhemerval Zanella 2022-05-13 14:23 Adhemerval Zanella 2022-05-12 19:37 Adhemerval Zanella 2022-05-10 18:27 Adhemerval Zanella 2022-04-29 14:07 Adhemerval Zanella 2022-04-04 12:57 Adhemerval Zanella 2022-03-31 19:10 Adhemerval Zanella 2022-03-29 20:33 Adhemerval Zanella
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220609212335.03BF23850236@sourceware.org \ --to=azanella@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).