From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id K2HhNQR7RmOTSQoAWB0awg (envelope-from ) for ; Wed, 12 Oct 2022 04:29:56 -0400 Received: by simark.ca (Postfix, from userid 112) id CBC581E112; Wed, 12 Oct 2022 04:29:56 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RDNS_DYNAMIC autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 0BCA91E0D3 for ; Wed, 12 Oct 2022 04:29:55 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3817B3860755 for ; Wed, 12 Oct 2022 08:29:54 +0000 (GMT) Received: from lug-owl.de (lug-owl.de [188.68.32.151]) by sourceware.org (Postfix) with ESMTPS id 510793856DD6 for ; Wed, 12 Oct 2022 08:29:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 510793856DD6 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=lug-owl.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=lug-owl.de Received: by lug-owl.de (Postfix, from userid 1001) id 3F3A7420C9; Wed, 12 Oct 2022 10:29:40 +0200 (CEST) Date: Wed, 12 Oct 2022 10:29:40 +0200 From: Jan-Benedict Glaw To: Andrew Burgess Subject: Re: [PATCH v2 6/7] sim/ppc: Add ATTRIBUTE_PRINTF Message-ID: <20221012082940.44hq4m7qkudpvyl5@lug-owl.de> References: <9ee0350e33400397851bb55c129a675519e5f174.1665038133.git.research_trasio@irq.a4lg.com> <8735bucu5p.fsf@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6tmoehgu2ulja6w2" Content-Disposition: inline In-Reply-To: <8735bucu5p.fsf@redhat.com> X-Operating-System: Linux chamaeleon 5.14.0-0.bpo.2-amd64 X-gpg-fingerprint: 250D 3BCF 7127 0D8C A444 A961 1DBD 5E75 8399 E1BB X-gpg-key: wwwkeys.de.pgp.net X-Echelon-Enable: howto poison arsenous mail psychological biological nuclear warfare test the bombastical terror of flooding the spy listeners explosion sex drugs and rock'n'roll X-TKUeV: howto poison arsenous mail psychological biological nuclear warfare test the bombastical terror of flooding the spy listeners explosion sex drugs and rock'n'roll X-message-flag: Please send plain text messages only. Do not send HTML emails. Thank you. User-Agent: NeoMutt/20170113 (1.7.2) 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: , Cc: "Frank Ch . Eigler" , gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" --6tmoehgu2ulja6w2 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, 2022-10-11 15:27:30 +0100, Andrew Burgess via Gdb-patches wrote: > Tsukasa OI writes: >=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). > > > > To avoid warnings on the printf-like wrapper, it requires proper > > __attribute__((format)) and we have ATTRIBUTE_PRINTF macro for this rea= son. > > > > This commit adds ATTRIBUTE_PRINTF to the printf-like functions. >=20 > I've pushed this patch, but I moved all the ATTRIBUTE_PRINTF attributes > to the function declarations. >=20 > Also, one of the definitions already had an ATTRIBUTE_NORETURN, I moved > this to the declaration too. Building with a recent GCC, I get this: $ .../configure --prefix=3D/tmp/gdb-ppc-elf --target=3Dppc-elf $ make V=3D1 all-gdb [...] /usr/lib/gcc-snapshot/bin/gcc -c -g -O2 -Werror -DDEFAULT_INLINE=3D0 -DWI= TH_SMP=3D5 -DHAVE_TERMIOS_STRUCTURE -DHAVE_TERMIOS_CLINE -DHAVE_DEVZ= ERO -Wall -Wdeclaration-after-statement -Wpointer-arith -Wno-unused -Wunuse= d-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wu= nused-but-set-parameter -Wno-error=3Dmaybe-uninitialized -Wmissing-declarat= ions -Wmissing-prototypes -Wdeclaration-after-statement -Wmissing-parameter= -type -Wpointer-sign -Wold-style-declaration -I. -I. -I./../../include -I..= /../bfd -I./../../bfd -I../../gdb -I./../../gdb -I./../../gdb/config -I../= =2E. -I./../../gnulib/import -I../../gnulib/import -DHAVE_COMMON_FPU -I../= common -I./../common emul_generic.c /usr/lib/gcc-snapshot/bin/gcc -c -g -O2 -Werror -DDEFAULT_INLINE=3D0 -DWI= TH_SMP=3D5 -DHAVE_TERMIOS_STRUCTURE -DHAVE_TERMIOS_CLINE -DHAVE_DEVZ= ERO -Wall -Wdeclaration-after-statement -Wpointer-arith -Wno-unused -Wunuse= d-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wu= nused-but-set-parameter -Wno-error=3Dmaybe-uninitialized -Wmissing-declarat= ions -Wmissing-prototypes -Wdeclaration-after-statement -Wmissing-parameter= -type -Wpointer-sign -Wold-style-declaration -I. -I. -I./../../include -I..= /../bfd -I./../../bfd -I../../gdb -I./../../gdb -I./../../gdb/config -I../= =2E. -I./../../gnulib/import -I../../gnulib/import -DHAVE_COMMON_FPU -I../= common -I./../common emul_bugapi.c emul_bugapi.c: In function 'emul_bugapi_instruction_call': emul_bugapi.c:495:11: error: format '%lx' expects argument of type 'long un= signed int', but argument 3 has type 'spreg' {aka 'unsigned int'} [-Werror= =3Dformat=3D] 495 | error("emul-bugapi: unimplemented bugapi %s from address 0x%lx\= n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~ cc1: all warnings being treated as errors make[3]: *** [Makefile:144: emul_bugapi.o] Error 1 make[3]: Leaving directory '/var/lib/laminar/run/gdb-ppc-elf/6/binutils-gdb= /sim/ppc' make[2]: *** [Makefile:1933: all-recursive] Error 1 make[2]: Leaving directory '/var/lib/laminar/run/gdb-ppc-elf/6/binutils-gdb= /sim' make[1]: *** [Makefile:1185: all] Error 2 make[1]: Leaving directory '/var/lib/laminar/run/gdb-ppc-elf/6/binutils-gdb= /sim' make: *** [Makefile:11309: all-sim] Error 2 MfG, JBG --=20 --6tmoehgu2ulja6w2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQQlDTvPcScNjKREqWEdvV51g5nhuwUCY0Z68gAKCRAdvV51g5nh uyDLAJ4uc9fOuuOWWAPyo/y5asl/9CzBXwCgiBasR7O4iXzhRGUdWW5OSlJIRGI= =x2/i -----END PGP SIGNATURE----- --6tmoehgu2ulja6w2--