From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 288DC3858C5F; Thu, 9 Feb 2023 19:46:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 288DC3858C5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675971977; bh=fP6NwWt8GMOFZsarLRtVGaRIjqt55QlkIdmlHmfPTSU=; h=From:To:Subject:Date:From; b=cT1HImFEqGR9sP60tBLRiwdVxjurBho038UFJi51DD7xFdfjeIDHeuMv9FpHMbeJF DizS8toiOTv6vWvgCCXbwU96WQHypIxiwW889+6tVB5FBQ9Ul8ShxHEuHeBPdMhZD2 ICp1/FIRpEslSBnmxn+I/9J+m/WjZcQVn8aY85Sc= 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] diag: Add clang specific DIAG_PUSH_NEEDS_COMMENT macros X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: 085824a254e0caf2b7e38747497a935f2c58adb8 X-Git-Newrev: f61b027f83e9dc61e753bdcab984b71f02722800 Message-Id: <20230209194617.288DC3858C5F@sourceware.org> Date: Thu, 9 Feb 2023 19:46:17 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f61b027f83e9dc61e753bdcab984b71f02722800 commit f61b027f83e9dc61e753bdcab984b71f02722800 Author: Adhemerval Zanella Date: Wed Aug 24 12:06:00 2022 -0300 diag: Add clang specific DIAG_PUSH_NEEDS_COMMENT macros Diff: --- include/libc-diag.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/libc-diag.h b/include/libc-diag.h index f8fbda15a5..82ee6725bb 100644 --- a/include/libc-diag.h +++ b/include/libc-diag.h @@ -71,6 +71,19 @@ # define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option) #endif +/* Same as before, but only enables the warning suppression for clang. + It is for clang-only issues and options that only clang emits. */ +#ifdef __clang__ +# define DIAG_PUSH_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic push") +# define DIAG_POP_NEEDS_COMMENT_CLANG _Pragma ("clang diagnostic pop") +# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) \ + _Pragma (_DIAG_STR (clang diagnostic ignored option)) +#else +# define DIAG_PUSH_NEEDS_COMMENT_CLANG +# define DIAG_POP_NEEDS_COMMENT_CLANG +# define DIAG_IGNORE_NEEDS_COMMENT_CLANG(version, option) +#endif + /* Some warnings are not support for all compilers. */ #ifndef __clang__ # define DIAG_IGNORE_NEEDS_COMMENT_GCC(VERSION, WARNING) \