From patchwork Thu Jan 11 03:31:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 83813 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A360C3857349 for ; Thu, 11 Jan 2024 03:31:55 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 3A9533858C36 for ; Thu, 11 Jan 2024 03:31:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3A9533858C36 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3A9533858C36 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:ea4a:1:5054:ff:fec7:86e4 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704943893; cv=none; b=mNgZJFvyYYKiUT9V9bp2RSKXvme85pJd5Cng8TzlRqzuFbO6of55rx+tK+LoBEx4Xrrr3VFma6jrqvAlxZjkv4UlDzNn8CJMMaCB8lAIcvbSd/pMbwtBsxVkeh5bU5ndSRs9b0k9Utxf0QKutXglsNKuu3V85OGYdY+5iG89y8E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704943893; c=relaxed/simple; bh=uWdkgc/JE019nrCFF7J/lw5iAWSXQItttdwkzFVaYdA=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=oe6qsPk9Q0AKc9Cqo8s5VyOmqxJ5KvS4I7e5Qh3DlzVR8H2ubYQS9ax0V+gaQs9Q0KkEr7DmxAgtEY8p9J8n/TzwqyaVhVHuR7C6dMHV7pME6U4jleqo8BZAnEINFhRUk1IQNK2QAAA2rTa4Nt2zxTg8lrKnSE69lQ2niSCYjLo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 47DF03431E8; Thu, 11 Jan 2024 03:31:31 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed] sim: igen: add printf attributes to the prototypes too Date: Wed, 10 Jan 2024 22:31:29 -0500 Message-ID: <20240111033129.25402-1-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org While gcc propagates the printf attribute via the typedef, clang doesn't seem to, so add it to the prototypes themselves too. We still keep it on the prototype for cases where it's used as a variable. --- sim/igen/misc.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sim/igen/misc.h b/sim/igen/misc.h index 04a7f720b41d..5b3a1f03e710 100644 --- a/sim/igen/misc.h +++ b/sim/igen/misc.h @@ -50,11 +50,11 @@ struct _line_ref /* Error appends a new line, warning and notify do not */ typedef void error_func (const line_ref *line, const char *msg, ...) - ATTRIBUTE_PRINTF (2, 3); + ATTRIBUTE_PRINTF_2; -extern ATTRIBUTE_NORETURN error_func error; -extern error_func warning; -extern error_func notify; +extern error_func error ATTRIBUTE_PRINTF_2 ATTRIBUTE_NORETURN; +extern error_func warning ATTRIBUTE_PRINTF_2; +extern error_func notify ATTRIBUTE_PRINTF_2; #define ERROR(EXPRESSION, args...) \