From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id B64B63858427; Wed, 17 Apr 2024 20:11:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B64B63858427 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1713384662; bh=TjO1oZPhoB/b+eIDVijqccf2h/9EnYdFfy1eOO7x/T0=; h=From:To:Subject:Date:From; b=tzGHcwf/aq7Z/i9YRo9c2Mlz8y8sC33iUxcXB7oidjYmrGZcw9BWQ3svwbN/wTkP8 mdk9DI3y2c9BaHa8tc5bjaO8Zytx6sWoVQR44AiQUGE6YMMuxUxsks0TlXslymi6zX AePy2pR/5j4BxgO4ftzK+/wDSgWj3OutkBupI6Uk= 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: a221274e314e48c3bd749ba3a491b430a864d29c X-Git-Newrev: 367d2d90444b50233aae754903898f4c15c181f0 Message-Id: <20240417201102.B64B63858427@sourceware.org> Date: Wed, 17 Apr 2024 20:11:02 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=367d2d90444b50233aae754903898f4c15c181f0 commit 367d2d90444b50233aae754903898f4c15c181f0 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;