From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 9C53F3858297; Fri, 28 Oct 2022 17:45:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C53F3858297 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666979118; bh=zkqgsqhExgM8rtQF2m9ob3UVHY7+Xb8ScGzituhUNbw=; h=From:To:Subject:Date:From; b=PBGZfwMf6G0Z4X4nmPH5v6rNYC/5MXPvZfjBNwTaPHw9lNN3UNZ1qPRl1tbvW1gHj k0aKGzVe37rjMp9LPfwCxzbCTAO0ASMEoXD2smxqshuLCyYuAspKJPrlr50k0U7elc 58XZkrc+TBSRMwdNCU9wQOx8SvSi3ME1NgboKOBI= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] elf: Suppress clang warning on tst-unique4 X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: c49a43c151f7049a18ca5dfd511eb641a5cdeca9 X-Git-Newrev: c36dffb13151898490a14c7bcd9d949f0475cbb1 Message-Id: <20221028174518.9C53F3858297@sourceware.org> Date: Fri, 28 Oct 2022 17:45:18 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c36dffb13151898490a14c7bcd9d949f0475cbb1 commit c36dffb13151898490a14c7bcd9d949f0475cbb1 Author: Adhemerval Zanella 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 +#include +/* 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 S::i = N; +int S::i __attribute__ ((used)) = N; template const int S::j __attribute__ ((used)) = -1;