public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Sergey Bugaev <bugaevc@gmail.com>
To: libc-alpha@sourceware.org
Cc: Nick Desaulniers <ndesaulniers@google.com>
Subject: [PATCH v3 3/5] cdefs.h: Enable __errordecl & __warnattr for Clang 14+
Date: Sun, 18 Jun 2023 01:22:16 +0300	[thread overview]
Message-ID: <20230617222218.642125-4-bugaevc@gmail.com> (raw)
In-Reply-To: <20230617222218.642125-1-bugaevc@gmail.com>

Clang 14 (released in March 2022) has added support for
attribute ((error)) and attribute ((warning)). Enable their usage when
Clang 14 or later is detected, to get nicer diagnostics.

https://reviews.llvm.org/D106030
https://github.com/llvm/llvm-project/commit/846e562dcc6a9a611d844dc0d123da95629a0567

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
---
 misc/sys/cdefs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 6ca8ca31..9b84043f 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -208,7 +208,7 @@
       : __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s))))
 #endif
 
-#if __GNUC_PREREQ (4,3)
+#if __GNUC_PREREQ (4,3) || __glibc_clang_prereq (14,0)
 # define __warnattr(msg) __attribute__((__warning__ (msg)))
 # define __errordecl(name, msg) \
   extern void name (void) __attribute__((__error__ (msg)))
-- 
2.41.0


  parent reply	other threads:[~2023-06-17 22:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-17 22:22 [PATCH v3 0/5] fcntl fortification Sergey Bugaev
2023-06-17 22:22 ` [PATCH v3 1/5] support: Add support_fcntl_support_ofd_locks () Sergey Bugaev
2023-06-17 22:22 ` [PATCH v3 2/5] cdefs.h: Define __glibc_warn_system_headers_{begin,end} Sergey Bugaev
2023-06-17 22:22 ` Sergey Bugaev [this message]
2023-06-17 22:22 ` [PATCH v3 4/5] io: Add FORTIFY_SOURCE check for fcntl arguments Sergey Bugaev
2023-06-17 22:22 ` [PATCH v3 5/5] io: Also verify 2-arg fctnl calls at runtime Sergey Bugaev
2023-06-19 12:58 ` [PATCH v3 0/5] fcntl fortification Carlos O'Donell
2023-06-19 14:23   ` Sergey Bugaev
2023-06-19 18:36     ` Adhemerval Zanella Netto
2023-06-20  5:59       ` Maxim Kuvyrkov
2023-06-20  7:33         ` Sergey Bugaev
2023-06-20  9:41           ` Maxim Kuvyrkov
2023-06-20 11:28             ` Sergey Bugaev
2023-06-20 12:38               ` Maxim Kuvyrkov
2023-06-20 12:53                 ` Sergey Bugaev
2023-06-20 13:40                   ` Adhemerval Zanella Netto
2023-06-20 13:47                     ` Zack Weinberg
2023-06-20 13:46                   ` Zack Weinberg
2023-06-20 12:50         ` Adhemerval Zanella Netto
2023-06-20 14:21           ` Frederic Berat
2023-07-21 13:59       ` Adhemerval Zanella Netto
2023-07-21 15:50         ` Sergey Bugaev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230617222218.642125-4-bugaevc@gmail.com \
    --to=bugaevc@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=ndesaulniers@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).