From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id B12423836E96; Wed, 30 Aug 2023 12:34:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B12423836E96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1693398861; bh=rRVjMYnhQ1/1RWQczUqz0vTgNNvxrzn7C3GbhEj1Urk=; h=From:To:Subject:Date:From; b=CHkfjJ/wOyTk5zsYZUqwV6N5BfmWNVwb/lIA1aguyob5HFOvUL4f6qVNvfotcN9DP SFCdkgRZocxodjzhkFBx1YBR0NNPcOfsypLacU1gch8GNSz7zWaQWkbM29Ds9E65ZV iVk1NrH5xfa5xMLmgQAW2IF0NKn9xGG0oLziqPN8= 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: 0cd0e48738055d717aa26415b0ab35fe783a03ca X-Git-Newrev: bedfd81db81e2fc64e5afb541d5a4a4ce611b98d Message-Id: <20230830123421.B12423836E96@sourceware.org> Date: Wed, 30 Aug 2023 12:34:21 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=bedfd81db81e2fc64e5afb541d5a4a4ce611b98d commit bedfd81db81e2fc64e5afb541d5a4a4ce611b98d 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) \