From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 795ED385841D; Tue, 2 Apr 2024 15:57:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 795ED385841D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1712073432; bh=PV1+0RNoch+N96yW66HO9R3dmaa8Uld8cuMe8jY4Xjk=; h=From:To:Subject:Date:From; b=EmcNabk8dqcXV7rQPdoxuQhxeIGG3m0N9+Ix5enA+9tn1TXgMzqqIoaPxiaDQhm01 F5ywT6dXFx+EyLwidx9oow7fLylMlACeTgo6V/pDHJdSq8croCF+EYMassPz9Dxy64 oAOfgVF2KAn+Z5HfwWiSfWT/VUUW9lbCETGPA3vw= 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: 5f2c5c80e32b8ba9489ba0b52d12af0c72691cfb X-Git-Newrev: 18f92a9b979d00e96629b1c15161d68274b10784 Message-Id: <20240402155712.795ED385841D@sourceware.org> Date: Tue, 2 Apr 2024 15:57:12 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=18f92a9b979d00e96629b1c15161d68274b10784 commit 18f92a9b979d00e96629b1c15161d68274b10784 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;