From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id 7F79E3858401; Tue, 11 Oct 2022 14:19:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7F79E3858401 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665497941; bh=0kO4gmHhK9N6kNeOW9JTmeRD8NCa06QagvnVzkDzHmU=; h=From:To:Subject:Date:From; b=Rkmw0nwSZzOxZywnxFmRq19O5edfCNWf9Ok+AOg1a6klK2VVQVYR6tXqFxJVFOJ1t qCELvvP2NX9Vx1Pmdq/MBd+2R8Z0VicniyINvwD5eZU5Y+g7CWnEJB1FS1oOTi3Eah WTpS5q/BxHvehGXzEhkQD07d6X5F822ZyNb03JWw= 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/m68hc11: Add ATTRIBUTE_PRINTF X-Act-Checkin: binutils-gdb X-Git-Author: Tsukasa OI X-Git-Refname: refs/heads/master X-Git-Oldrev: fe8732f93993b99fb257ebd38b47d64f2e4400b4 X-Git-Newrev: 7f9495b21380c0184dde72920bcca37be9d76b9d Message-Id: <20221011141901.7F79E3858401@sourceware.org> Date: Tue, 11 Oct 2022 14:19:01 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D7f9495b21380= c0184dde72920bcca37be9d76b9d commit 7f9495b21380c0184dde72920bcca37be9d76b9d Author: Tsukasa OI Date: Thu Oct 6 06:36:31 2022 +0000 sim/m68hc11: 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/m68hc11/sim-main.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sim/m68hc11/sim-main.h b/sim/m68hc11/sim-main.h index e667c33a705..78dbd672867 100644 --- a/sim/m68hc11/sim-main.h +++ b/sim/m68hc11/sim-main.h @@ -539,7 +539,8 @@ extern void cpu_set_sp (sim_cpu *cpu, uint16_t val); extern int cpu_reset (sim_cpu *cpu); extern int cpu_restart (sim_cpu *cpu); extern void sim_memory_error (sim_cpu *cpu, SIM_SIGNAL excep, - uint16_t addr, const char *message, ...); + uint16_t addr, const char *message, ...) + ATTRIBUTE_PRINTF (4, 5); extern void emul_os (int op, sim_cpu *cpu); extern void cpu_interp_m6811 (sim_cpu *cpu); extern void cpu_interp_m6812 (sim_cpu *cpu);