From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Cc: Tsukasa OI , Mike Frysinger , Stephane Carrez , "Frank Ch . Eigler" , gdb-patches@sourceware.org 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-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-List-Received-Date: Wed, 12 Oct 2022 08:29:43 -0000 --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--