From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 4D648385841F; Tue, 4 Oct 2022 12:57:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4D648385841F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664888229; bh=J6p15oH54cyalWiVYFKZZDEUzSqjm3gNBMrBRG1ZwSA=; h=From:To:Subject:Date:From; b=kJjuy5kfc7OWK1obgnHKWVV46ZSbMa3cGdBsjs2rnMFJLe2smYEiLJB0oy89HPquM ghUa5jthKPEvYKAK4I2dBvNCPMq8wCoi679ok6JO43zgT/k4XPnPxdHIX2n3s6na/7 jgupd/jl8zVQb1zTs91qZ2ec17atc1eYDCfSuH3M= 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: 7373a986fbb2066a5b17cd98fa3d2f49a33cde5c X-Git-Newrev: 11a3936c48655b43e12a5fc56987cbbcc67f3bcd Message-Id: <20221004125709.4D648385841F@sourceware.org> Date: Tue, 4 Oct 2022 12:57:09 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=11a3936c48655b43e12a5fc56987cbbcc67f3bcd commit 11a3936c48655b43e12a5fc56987cbbcc67f3bcd 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 e1dbe99eb3..61e33d6c36 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) \