From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id 9F9963858C2D; Tue, 11 Oct 2022 14:19:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F9963858C2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665497951; bh=PvmxxWBC+Yspo17zcR8JLRZD99D4sQPhaOD1EyyycF4=; h=From:To:Subject:Date:From; b=Ntp5Y1XG5yPkl5sKd1KR56TSPSSnrvjW3HM+TlLnOJwdoyAb+zNxzVBv2BVOtu9HR s5vdNarPamNnjZl4t3by8av66d1XuI6pOqBEqtF9C3bzcruo45480caPlm1btY83iB 5Fp/vVIYWoLGD+svia/kz+ANAyFqu7fx5VTe257I= 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/rl78: Add ATTRIBUTE_PRINTF X-Act-Checkin: binutils-gdb X-Git-Author: Tsukasa OI X-Git-Refname: refs/heads/master X-Git-Oldrev: 3efe5b4d9e431f58a17e38d17419d6bcc3a4dd11 X-Git-Newrev: e9a433bf192ddcadc7e948ef3b4e0ca64f3396e7 Message-Id: <20221011141911.9F9963858C2D@sourceware.org> Date: Tue, 11 Oct 2022 14:19:11 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3De9a433bf192d= dcadc7e948ef3b4e0ca64f3396e7 commit e9a433bf192ddcadc7e948ef3b4e0ca64f3396e7 Author: Tsukasa OI Date: Thu Oct 6 06:36:33 2022 +0000 sim/rl78: 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/rl78/trace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sim/rl78/trace.c b/sim/rl78/trace.c index 669c2b54615..85880774b14 100644 --- a/sim/rl78/trace.c +++ b/sim/rl78/trace.c @@ -92,7 +92,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; @@ -104,7 +104,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;