From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id 4E9D43858424; Tue, 11 Oct 2022 14:18:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4E9D43858424 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665497926; bh=b12oTa/yeczmClZr6G42M8VXG1qUTBDHmxW5f5diZGo=; h=From:To:Subject:Date:From; b=IJYbdDCdyyEB/GFRuojNq2FbwLuxg+b8fpUjtFRTFeUUpKgXQkLIxNMuVIB75pOXg jS6jX9UbyWcueifm79uJOEeo7DUlSS0nsrqXHZKd74oTX093PdSl71Gg3ol3R7KuRW i2pkpVqsVxtM/rk7NqPDMMet24az77pRxo6ohQfg= 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/cris: Add ATTRIBUTE_PRINTF X-Act-Checkin: binutils-gdb X-Git-Author: Tsukasa OI X-Git-Refname: refs/heads/master X-Git-Oldrev: 7aaf9c03d143802302c49ed70d05766c9cf3cb5b X-Git-Newrev: a26c7ec2114d75d518cda714cc8a0ec05b745ae5 Message-Id: <20221011141846.4E9D43858424@sourceware.org> Date: Tue, 11 Oct 2022 14:18:46 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Da26c7ec2114d= 75d518cda714cc8a0ec05b745ae5 commit a26c7ec2114d75d518cda714cc8a0ec05b745ae5 Author: Tsukasa OI Date: Thu Oct 6 06:36:28 2022 +0000 sim/cris: 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 a printf-like function. Diff: --- 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..7b0140f1c90 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. */ =20 -static USI +static USI ATTRIBUTE_PRINTF (3, 4) cris_unknown_syscall (SIM_CPU *current_cpu, USI pc, char *s, ...) { SIM_DESC sd =3D CPU_STATE (current_cpu);