From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id 6EC123858401; Tue, 11 Oct 2022 14:18:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6EC123858401 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665497936; bh=9ODyi5DMCMJluQzkBK4j+FkcwzVFVf3C9ji8UXRnWi0=; h=From:To:Subject:Date:From; b=Q0n4teG7rFaZZcHf0Pzlk0aAMzA42BfCjEWgqgP9SNCJ8G/+cl6ZWboSdz1649xa0 8tGL0BwNREmPBOOYfQX+SGQcde0cRsEipuldj318/iqqDxojXRHKDCTBrwc4X7MTSd /7iiQvWY2bl3cP1pnAcZZXJNa7Z7AiQRJSjBXGgw= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Andrew Burgess To: gdb-cvs@sourceware.org Subject: [binutils-gdb] sim/m32c: Add ATTRIBUTE_PRINTF X-Act-Checkin: binutils-gdb X-Git-Author: Tsukasa OI X-Git-Refname: refs/heads/master X-Git-Oldrev: 682389d557f7fa472b66de568ab0089d754ed757 X-Git-Newrev: fe8732f93993b99fb257ebd38b47d64f2e4400b4 Message-Id: <20221011141856.6EC123858401@sourceware.org> Date: Tue, 11 Oct 2022 14:18:56 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dfe8732f93993= b99fb257ebd38b47d64f2e4400b4 commit fe8732f93993b99fb257ebd38b47d64f2e4400b4 Author: Tsukasa OI Date: Thu Oct 6 06:36:30 2022 +0000 sim/m32c: Add ATTRIBUTE_PRINTF =20 Clang generates a warning if the format string of a printf-like functio= n is not a literal ("-Wformat-nonliteral"). On the default configuration, it causes a build failure (unless "--disable-werror" is specified). =20 To avoid warnings on the printf-like wrapper, it requires proper __attribute__((format)) and we have ATTRIBUTE_PRINTF macro for this rea= son. =20 This commit adds ATTRIBUTE_PRINTF to the printf-like functions. Diff: --- sim/m32c/trace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sim/m32c/trace.c b/sim/m32c/trace.c index 1888e69122b..2f6373dd5f8 100644 --- a/sim/m32c/trace.c +++ b/sim/m32c/trace.c @@ -89,7 +89,7 @@ compare_symbols (const void *ap, const void *bp) =20 static char opbuf[1000]; =20 -static int +static int ATTRIBUTE_PRINTF (2, 3) op_printf (char *buf, char *fmt, ...) { int ret; @@ -101,7 +101,7 @@ op_printf (char *buf, char *fmt, ...) return ret; } =20 -static int +static int ATTRIBUTE_PRINTF (3, 4) op_styled_printf (char *buf, enum disassembler_style style, char *fmt, ...) { int ret;