From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: Andrew Burgess <aburgess@redhat.com>
Cc: Tsukasa OI <research_trasio@irq.a4lg.com>,
Mike Frysinger <vapier@gentoo.org>,
Stephane Carrez <Stephane.Carrez@gmail.com>,
"Frank Ch . Eigler" <fche@redhat.com>,
gdb-patches@sourceware.org
Subject: Re: [PATCH v2 6/7] sim/ppc: Add ATTRIBUTE_PRINTF
Date: Wed, 12 Oct 2022 10:29:40 +0200 [thread overview]
Message-ID: <20221012082940.44hq4m7qkudpvyl5@lug-owl.de> (raw)
In-Reply-To: <8735bucu5p.fsf@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3265 bytes --]
On Tue, 2022-10-11 15:27:30 +0100, Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org> wrote:
> Tsukasa OI <research_trasio@irq.a4lg.com> writes:
>
> > Clang generates a warning if the format string of a printf-like function 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 reason.
> >
> > This commit adds ATTRIBUTE_PRINTF to the printf-like functions.
>
> I've pushed this patch, but I moved all the ATTRIBUTE_PRINTF attributes
> to the function declarations.
>
> 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=/tmp/gdb-ppc-elf --target=ppc-elf
$ make V=1 all-gdb
[...]
/usr/lib/gcc-snapshot/bin/gcc -c -g -O2 -Werror -DDEFAULT_INLINE=0 -DWITH_SMP=5 -DHAVE_TERMIOS_STRUCTURE -DHAVE_TERMIOS_CLINE -DHAVE_DEVZERO -Wall -Wdeclaration-after-statement -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter -Wno-error=maybe-uninitialized -Wmissing-declarations -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../.. -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=0 -DWITH_SMP=5 -DHAVE_TERMIOS_STRUCTURE -DHAVE_TERMIOS_CLINE -DHAVE_DEVZERO -Wall -Wdeclaration-after-statement -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter -Wno-error=maybe-uninitialized -Wmissing-declarations -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../.. -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 unsigned int', but argument 3 has type 'spreg' {aka 'unsigned int'} [-Werror=format=]
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
--
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2022-10-12 8:29 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-25 8:44 [PATCH 0/7] sim, sim/ARCH: " Tsukasa OI
2022-09-25 8:44 ` [PATCH 1/7] sim: " Tsukasa OI
2022-09-25 8:44 ` [PATCH 2/7] sim/cris: " Tsukasa OI
2022-09-25 8:44 ` [PATCH 3/7] sim/erc32: " Tsukasa OI
2022-09-25 8:44 ` [PATCH 4/7] sim/m32c: " Tsukasa OI
2022-09-25 8:44 ` [PATCH 5/7] sim/m68hc11: " Tsukasa OI
2022-09-25 8:44 ` [PATCH 6/7] sim/ppc: " Tsukasa OI
2022-10-05 10:57 ` Andrew Burgess
2022-10-06 5:32 ` Tsukasa OI
2022-09-25 8:44 ` [PATCH 7/7] sim/rl78: " Tsukasa OI
2022-10-06 6:36 ` [PATCH v2 0/7] sim, sim/ARCH: " Tsukasa OI
2022-10-06 6:36 ` [PATCH v2 1/7] sim: " Tsukasa OI
2022-10-11 14:24 ` Andrew Burgess
2022-10-06 6:36 ` [PATCH v2 2/7] sim/cris: " Tsukasa OI
2022-10-06 6:36 ` [PATCH v2 3/7] sim/erc32: " Tsukasa OI
2022-10-06 6:36 ` [PATCH v2 4/7] sim/m32c: " Tsukasa OI
2022-10-06 6:36 ` [PATCH v2 5/7] sim/m68hc11: " Tsukasa OI
2022-10-11 14:25 ` Andrew Burgess
2022-10-06 6:36 ` [PATCH v2 6/7] sim/ppc: " Tsukasa OI
2022-10-11 14:27 ` Andrew Burgess
2022-10-12 8:29 ` Jan-Benedict Glaw [this message]
2022-10-12 9:39 ` Andrew Burgess
2022-10-12 10:36 ` Jan-Benedict Glaw
2022-10-12 12:15 ` Jan-Benedict Glaw
2022-10-12 12:50 ` Jan-Benedict Glaw
2022-10-12 13:16 ` Tsukasa OI
2022-10-12 12:38 ` [PATCH 0/1] sim/ppc: Fix erroneous error calls (supplement) Tsukasa OI
2022-10-12 12:38 ` [PATCH 1/1] sim/ppc: Fix core_find_mapping diagnostics Tsukasa OI
2022-10-12 13:50 ` Andrew Burgess
2022-10-23 12:46 ` [PATCH v2 6/7] sim/ppc: Add ATTRIBUTE_PRINTF Mike Frysinger
2022-10-06 6:36 ` [PATCH v2 7/7] sim/rl78: " Tsukasa OI
2022-10-11 14:23 ` [PATCH v2 0/7] sim, sim/ARCH: " Andrew Burgess
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221012082940.44hq4m7qkudpvyl5@lug-owl.de \
--to=jbglaw@lug-owl.de \
--cc=Stephane.Carrez@gmail.com \
--cc=aburgess@redhat.com \
--cc=fche@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=research_trasio@irq.a4lg.com \
--cc=vapier@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).