From patchwork Sun Jul 30 19:25:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Bugaev X-Patchwork-Id: 1814688 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=Gue4kfNb; dkim-atps=neutral Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RDWbV6QP2z1yf1 for ; Mon, 31 Jul 2023 05:27:18 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CE9463857715 for ; Sun, 30 Jul 2023 19:27:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CE9463857715 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690745236; bh=3Wy60AO0hcvmIXzWbNQddVWo21EzNq/TupnwNCFsDL0=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Gue4kfNbZTo0AvC5zEFwvrJzLBI3FRUgPc2k/CYPapYaMFqtkKxYCJUtFQkdu8W7j XTAH2T4yhLhrorHUMhOY8MSHxfB/Gz60C6J4k1NYo2j10optQagben2GXsaiwBz4R5 fTVb5RuvI+Tb/bJXDhbfw3o4xmHu9BY+N1/Anp7o= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by sourceware.org (Postfix) with ESMTPS id A149F3858C3A for ; Sun, 30 Jul 2023 19:26:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A149F3858C3A Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-4fb7dc16ff0so6056223e87.2 for ; Sun, 30 Jul 2023 12:26:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690745175; x=1691349975; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3Wy60AO0hcvmIXzWbNQddVWo21EzNq/TupnwNCFsDL0=; b=fu+FyZ98RgKxWImk2jP9vcNktm8NuKIA3dJsjNeNvHOAQDhOhU69M69vRzlfGGoClZ KRtRpy1iOxUxzZme0UdO7flNcI2b0Ibp5M0E3BqCjJU43t0VZj2ZsrOac7p6OliQNoWj BsYhjmLr3iICj03coztLQOIx6e+Zc88r6tY3oF08C2iPZoD38s4B9CJ7cIcxCZYFDvMl iZ+GarKBzHigZGrkflGeLMUh9kF7hA272FbcuXhwMcMfGgg4ro0iZWBjCGFnpyuEsgou nqA3lB+kl6tOLx+c5OYZFa2yTwmVId398YikL2Zjxf6leQQvaoZyBTe5WgfmZFOYqUWW QTKw== X-Gm-Message-State: ABy/qLY+OtmNuDuEPgvQhp3/Y5tTFCGf+tldDv1n1LpbX5ZabjaNjWkF sgQSRJoWkP2QifQv598/X05cX7adPWX8Qg== X-Google-Smtp-Source: APBJJlGucR+blBmHGj3ucHsEkYeWenrBonnfUeBBbKshvW7p1p4DyCjOm6ZPLJecyTSJGaw31w6Bww== X-Received: by 2002:a05:6512:39c5:b0:4fd:d481:ff35 with SMTP id k5-20020a05651239c500b004fdd481ff35mr4929160lfu.42.1690745175071; Sun, 30 Jul 2023 12:26:15 -0700 (PDT) Received: from localhost.localdomain ([2a02:2168:b344:a600:4435:f106:1598:d2b0]) by smtp.gmail.com with ESMTPSA id y8-20020a197508000000b004fe2f085d5csm532447lfe.299.2023.07.30.12.26.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jul 2023 12:26:14 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v4 4/6] cdefs.h: Enable __errordecl & __warnattr for Clang 14+ Date: Sun, 30 Jul 2023 22:25:59 +0300 Message-ID: <20230730192605.2423480-5-bugaevc@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230730192605.2423480-1-bugaevc@gmail.com> References: <20230730192605.2423480-1-bugaevc@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sergey Bugaev via Libc-alpha From: Sergey Bugaev Reply-To: Sergey Bugaev Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" 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 Reviewed-by: Adhemerval Zanella --- 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 15587848..5c98f393 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)))