From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender-0.a4lg.com [IPv6:2401:2500:203:30b:4000:6bfe:4757:0]) by sourceware.org (Postfix) with ESMTPS id 6EB7C385828F for ; Sun, 25 Sep 2022 08:44:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6EB7C385828F Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id BA7A2300089; Sun, 25 Sep 2022 08:44:45 +0000 (UTC) From: Tsukasa OI To: Tsukasa OI , Andrew Burgess , Mike Frysinger , Stephane Carrez , "Frank Ch . Eigler" Cc: gdb-patches@sourceware.org Subject: [PATCH 2/7] sim/cris: Add ATTRIBUTE_PRINTF Date: Sun, 25 Sep 2022 08:44:12 +0000 Message-Id: <933c98735904e8558f36bc042bf90a8448962182.1664095452.git.research_trasio@irq.a4lg.com> In-Reply-To: References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP 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.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Sep 2022 08:44:48 -0000 Clang generates a warning if the format string of a printf-like function is not a literal ("-Wformat-nonliteral"). On the default configuration, it causes a build failure (unless "--disable-werror" is specified). To avoid warnings on the printf-like wrapper, it requires proper __attribute__((format)) and we have ATTRIBUTE_PRINTF macro for this reason. This commit adds ATTRIBUTE_PRINTF to a printf-like function. sim/ChangeLog: * cris/traps.c (cris_unknown_syscall): Add ATTRIBUTE_PRINTF. --- sim/cris/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/cris/traps.c b/sim/cris/traps.c index 8750c4d4e3c..3cbbe4088e5 100644 --- a/sim/cris/traps.c +++ b/sim/cris/traps.c @@ -1382,7 +1382,7 @@ make_first_thread (SIM_CPU *current_cpu) /* Handle unknown system calls. Returns (if it does) the syscall return value. */ -static USI +static USI ATTRIBUTE_PRINTF(3, 4) cris_unknown_syscall (SIM_CPU *current_cpu, USI pc, char *s, ...) { SIM_DESC sd = CPU_STATE (current_cpu); -- 2.34.1