* [Qemu-devel] [PATCH] microblaze: Fix two format specifiers in disassembler
@ 2010-04-09 20:49 Stefan Weil
2010-04-09 20:49 ` [Qemu-devel] [PATCH] arm: Fix compiler warning (fprintf format string) Stefan Weil
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: Stefan Weil @ 2010-04-09 20:49 UTC (permalink / raw)
To: QEMU Developers
inst is unsigned long, so use %04lx instead of %04x.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
microblaze-dis.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/microblaze-dis.c b/microblaze-dis.c
index b26572f..9235fd8 100644
--- a/microblaze-dis.c
+++ b/microblaze-dis.c
@@ -826,7 +826,7 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info)
prev_insn_vma = curr_insn_vma;
if (op->name == 0) {
- fprintf (stream, ".short 0x%04x", inst);
+ fprintf (stream, ".short 0x%04lx", inst);
}
else
{
@@ -959,7 +959,7 @@ print_insn_microblaze (bfd_vma memaddr, struct disassemble_info * info)
break;
default:
/* if the disassembler lags the instruction set */
- fprintf (stream, "\tundecoded operands, inst is 0x%04x", inst);
+ fprintf (stream, "\tundecoded operands, inst is 0x%04lx", inst);
break;
}
}
--
1.5.6.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Qemu-devel] [PATCH] arm: Fix compiler warning (fprintf format string)
2010-04-09 20:49 [Qemu-devel] [PATCH] microblaze: Fix two format specifiers in disassembler Stefan Weil
@ 2010-04-09 20:49 ` Stefan Weil
2010-04-13 22:16 ` Aurelien Jarno
2010-04-09 20:49 ` [Qemu-devel] [PATCH] m68k: " Stefan Weil
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Stefan Weil @ 2010-04-09 20:49 UTC (permalink / raw)
To: QEMU Developers
When argument checking is enabled, gcc throws this error:
error: format not a string literal and no format arguments
The patch rewrites the statement to satisfy the compiler.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
arm-dis.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arm-dis.c b/arm-dis.c
index 4fb899e..5028555 100644
--- a/arm-dis.c
+++ b/arm-dis.c
@@ -3149,14 +3149,14 @@ print_insn_thumb16 (bfd_vma pc, struct disassemble_info *info, long given)
if (started)
func (stream, ", ");
started = 1;
- func (stream, arm_regnames[14] /* "lr" */);
+ func (stream, "%s", arm_regnames[14] /* "lr" */);
}
if (domaskpc)
{
if (started)
func (stream, ", ");
- func (stream, arm_regnames[15] /* "pc" */);
+ func (stream, "%s", arm_regnames[15] /* "pc" */);
}
func (stream, "}");
@@ -3699,7 +3699,7 @@ print_insn_thumb32 (bfd_vma pc, struct disassemble_info *info, long given)
}
else
{
- func (stream, psr_name (given & 0xff));
+ func (stream, "%s", psr_name (given & 0xff));
}
break;
@@ -3707,7 +3707,7 @@ print_insn_thumb32 (bfd_vma pc, struct disassemble_info *info, long given)
if ((given & 0xff) == 0)
func (stream, "%cPSR", (given & 0x100000) ? 'S' : 'C');
else
- func (stream, psr_name (given & 0xff));
+ func (stream, "%s", psr_name (given & 0xff));
break;
case '0': case '1': case '2': case '3': case '4':
--
1.5.6.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Qemu-devel] [PATCH] m68k: Fix compiler warning (fprintf format string)
2010-04-09 20:49 [Qemu-devel] [PATCH] microblaze: Fix two format specifiers in disassembler Stefan Weil
2010-04-09 20:49 ` [Qemu-devel] [PATCH] arm: Fix compiler warning (fprintf format string) Stefan Weil
@ 2010-04-09 20:49 ` Stefan Weil
2010-04-13 22:17 ` Aurelien Jarno
2010-04-09 20:49 ` [Qemu-devel] [PATCH] sh4: " Stefan Weil
` (2 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Stefan Weil @ 2010-04-09 20:49 UTC (permalink / raw)
To: QEMU Developers
When argument checking is enabled, gcc throws this error:
error: format not a string literal and no format arguments
The patch rewrites the statement to satisfy the compiler.
It also removes a type cast which is not needed.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
m68k-dis.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/m68k-dis.c b/m68k-dis.c
index d38d5a2..7cd88f8 100644
--- a/m68k-dis.c
+++ b/m68k-dis.c
@@ -1104,7 +1104,7 @@ print_insn_arg (const char *d,
{
static const char *const cacheFieldName[] = { "nc", "dc", "ic", "bc" };
val = fetch_arg (buffer, place, 2, info);
- (*info->fprintf_func) (info->stream, cacheFieldName[val]);
+ (*info->fprintf_func) (info->stream, "%s", cacheFieldName[val]);
break;
}
@@ -1199,7 +1199,7 @@ print_insn_arg (const char *d,
{
static const char *const scalefactor_name[] = { "<<", ">>" };
val = fetch_arg (buffer, place, 1, info);
- (*info->fprintf_func) (info->stream, scalefactor_name[val]);
+ (*info->fprintf_func) (info->stream, "%s", scalefactor_name[val]);
}
else
{
@@ -1804,7 +1804,7 @@ match_insn_m68k (bfd_vma memaddr,
save_p = p;
info->print_address_func = dummy_print_address;
- info->fprintf_func = (fprintf_ftype) dummy_printer;
+ info->fprintf_func = dummy_printer;
/* We scan the operands twice. The first time we don't print anything,
but look for errors. */
--
1.5.6.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Qemu-devel] [PATCH] sh4: Fix compiler warning (fprintf format string)
2010-04-09 20:49 [Qemu-devel] [PATCH] microblaze: Fix two format specifiers in disassembler Stefan Weil
2010-04-09 20:49 ` [Qemu-devel] [PATCH] arm: Fix compiler warning (fprintf format string) Stefan Weil
2010-04-09 20:49 ` [Qemu-devel] [PATCH] m68k: " Stefan Weil
@ 2010-04-09 20:49 ` Stefan Weil
2010-04-13 22:17 ` Aurelien Jarno
2010-04-09 20:49 ` [Qemu-devel] [PATCH] sparc: " Stefan Weil
2010-04-10 11:44 ` [Qemu-devel] [PATCH] microblaze: Fix two format specifiers in disassembler Thomas Monjalon
4 siblings, 1 reply; 10+ messages in thread
From: Stefan Weil @ 2010-04-09 20:49 UTC (permalink / raw)
To: QEMU Developers
When argument checking is enabled, gcc throws this error:
error: format not a string literal and no format arguments
The patch rewrites the statement to satisfy the compiler.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
sh4-dis.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sh4-dis.c b/sh4-dis.c
index 41fd866..078a6b2 100644
--- a/sh4-dis.c
+++ b/sh4-dis.c
@@ -1493,10 +1493,10 @@ print_insn_ppi (int field_b, struct disassemble_info *info)
print_dsp_reg (field_b & 0xf, fprintf_fn, stream);
break;
case DSP_REG_X:
- fprintf_fn (stream, sx_tab[(field_b >> 6) & 3]);
+ fprintf_fn (stream, "%s", sx_tab[(field_b >> 6) & 3]);
break;
case DSP_REG_Y:
- fprintf_fn (stream, sy_tab[(field_b >> 4) & 3]);
+ fprintf_fn (stream, "%s", sy_tab[(field_b >> 4) & 3]);
break;
case A_MACH:
fprintf_fn (stream, "mach");
--
1.5.6.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Qemu-devel] [PATCH] sparc: Fix compiler warning (fprintf format string)
2010-04-09 20:49 [Qemu-devel] [PATCH] microblaze: Fix two format specifiers in disassembler Stefan Weil
` (2 preceding siblings ...)
2010-04-09 20:49 ` [Qemu-devel] [PATCH] sh4: " Stefan Weil
@ 2010-04-09 20:49 ` Stefan Weil
2010-04-13 22:17 ` Aurelien Jarno
2010-04-10 11:44 ` [Qemu-devel] [PATCH] microblaze: Fix two format specifiers in disassembler Thomas Monjalon
4 siblings, 1 reply; 10+ messages in thread
From: Stefan Weil @ 2010-04-09 20:49 UTC (permalink / raw)
To: QEMU Developers
When argument checking is enabled, gcc throws this error:
error: format not a string literal and no format arguments
The patch rewrites the statement to satisfy the compiler.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
sparc-dis.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sparc-dis.c b/sparc-dis.c
index 83a12ae..611e74f 100644
--- a/sparc-dis.c
+++ b/sparc-dis.c
@@ -2778,7 +2778,7 @@ print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
/* Can't do simple format if source and dest are different. */
continue;
- (*info->fprintf_func) (stream, opcode->name);
+ (*info->fprintf_func) (stream, "%s", opcode->name);
{
const char *s;
--
1.5.6.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH] microblaze: Fix two format specifiers in disassembler
2010-04-09 20:49 [Qemu-devel] [PATCH] microblaze: Fix two format specifiers in disassembler Stefan Weil
` (3 preceding siblings ...)
2010-04-09 20:49 ` [Qemu-devel] [PATCH] sparc: " Stefan Weil
@ 2010-04-10 11:44 ` Thomas Monjalon
4 siblings, 0 replies; 10+ messages in thread
From: Thomas Monjalon @ 2010-04-10 11:44 UTC (permalink / raw)
To: qemu-devel
Stefan Weil wrote:
> inst is unsigned long, so use %04lx instead of %04x.
>
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
I've sent a patch
(http://lists.gnu.org/archive/html/qemu-devel/2010-04/msg00637.html)
which include this change and fix a bug, as explained by Paolo Bonzini:
http://lists.gnu.org/archive/html/qemu-devel/2010-04/msg00638.html
--
Thomas
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH] arm: Fix compiler warning (fprintf format string)
2010-04-09 20:49 ` [Qemu-devel] [PATCH] arm: Fix compiler warning (fprintf format string) Stefan Weil
@ 2010-04-13 22:16 ` Aurelien Jarno
0 siblings, 0 replies; 10+ messages in thread
From: Aurelien Jarno @ 2010-04-13 22:16 UTC (permalink / raw)
To: Stefan Weil; +Cc: QEMU Developers
On Fri, Apr 09, 2010 at 10:49:50PM +0200, Stefan Weil wrote:
> When argument checking is enabled, gcc throws this error:
>
> error: format not a string literal and no format arguments
>
> The patch rewrites the statement to satisfy the compiler.
>
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Thanks, applied.
> ---
> arm-dis.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arm-dis.c b/arm-dis.c
> index 4fb899e..5028555 100644
> --- a/arm-dis.c
> +++ b/arm-dis.c
> @@ -3149,14 +3149,14 @@ print_insn_thumb16 (bfd_vma pc, struct disassemble_info *info, long given)
> if (started)
> func (stream, ", ");
> started = 1;
> - func (stream, arm_regnames[14] /* "lr" */);
> + func (stream, "%s", arm_regnames[14] /* "lr" */);
> }
>
> if (domaskpc)
> {
> if (started)
> func (stream, ", ");
> - func (stream, arm_regnames[15] /* "pc" */);
> + func (stream, "%s", arm_regnames[15] /* "pc" */);
> }
>
> func (stream, "}");
> @@ -3699,7 +3699,7 @@ print_insn_thumb32 (bfd_vma pc, struct disassemble_info *info, long given)
> }
> else
> {
> - func (stream, psr_name (given & 0xff));
> + func (stream, "%s", psr_name (given & 0xff));
> }
> break;
>
> @@ -3707,7 +3707,7 @@ print_insn_thumb32 (bfd_vma pc, struct disassemble_info *info, long given)
> if ((given & 0xff) == 0)
> func (stream, "%cPSR", (given & 0x100000) ? 'S' : 'C');
> else
> - func (stream, psr_name (given & 0xff));
> + func (stream, "%s", psr_name (given & 0xff));
> break;
>
> case '0': case '1': case '2': case '3': case '4':
> --
> 1.5.6.5
>
>
>
>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH] m68k: Fix compiler warning (fprintf format string)
2010-04-09 20:49 ` [Qemu-devel] [PATCH] m68k: " Stefan Weil
@ 2010-04-13 22:17 ` Aurelien Jarno
0 siblings, 0 replies; 10+ messages in thread
From: Aurelien Jarno @ 2010-04-13 22:17 UTC (permalink / raw)
To: Stefan Weil; +Cc: QEMU Developers
On Fri, Apr 09, 2010 at 10:49:51PM +0200, Stefan Weil wrote:
> When argument checking is enabled, gcc throws this error:
>
> error: format not a string literal and no format arguments
>
> The patch rewrites the statement to satisfy the compiler.
> It also removes a type cast which is not needed.
>
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Thanks, applied.
> ---
> m68k-dis.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/m68k-dis.c b/m68k-dis.c
> index d38d5a2..7cd88f8 100644
> --- a/m68k-dis.c
> +++ b/m68k-dis.c
> @@ -1104,7 +1104,7 @@ print_insn_arg (const char *d,
> {
> static const char *const cacheFieldName[] = { "nc", "dc", "ic", "bc" };
> val = fetch_arg (buffer, place, 2, info);
> - (*info->fprintf_func) (info->stream, cacheFieldName[val]);
> + (*info->fprintf_func) (info->stream, "%s", cacheFieldName[val]);
> break;
> }
>
> @@ -1199,7 +1199,7 @@ print_insn_arg (const char *d,
> {
> static const char *const scalefactor_name[] = { "<<", ">>" };
> val = fetch_arg (buffer, place, 1, info);
> - (*info->fprintf_func) (info->stream, scalefactor_name[val]);
> + (*info->fprintf_func) (info->stream, "%s", scalefactor_name[val]);
> }
> else
> {
> @@ -1804,7 +1804,7 @@ match_insn_m68k (bfd_vma memaddr,
>
> save_p = p;
> info->print_address_func = dummy_print_address;
> - info->fprintf_func = (fprintf_ftype) dummy_printer;
> + info->fprintf_func = dummy_printer;
>
> /* We scan the operands twice. The first time we don't print anything,
> but look for errors. */
> --
> 1.5.6.5
>
>
>
>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH] sh4: Fix compiler warning (fprintf format string)
2010-04-09 20:49 ` [Qemu-devel] [PATCH] sh4: " Stefan Weil
@ 2010-04-13 22:17 ` Aurelien Jarno
0 siblings, 0 replies; 10+ messages in thread
From: Aurelien Jarno @ 2010-04-13 22:17 UTC (permalink / raw)
To: Stefan Weil; +Cc: QEMU Developers
On Fri, Apr 09, 2010 at 10:49:52PM +0200, Stefan Weil wrote:
> When argument checking is enabled, gcc throws this error:
>
> error: format not a string literal and no format arguments
>
> The patch rewrites the statement to satisfy the compiler.
>
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Thanks, applied.
> ---
> sh4-dis.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sh4-dis.c b/sh4-dis.c
> index 41fd866..078a6b2 100644
> --- a/sh4-dis.c
> +++ b/sh4-dis.c
> @@ -1493,10 +1493,10 @@ print_insn_ppi (int field_b, struct disassemble_info *info)
> print_dsp_reg (field_b & 0xf, fprintf_fn, stream);
> break;
> case DSP_REG_X:
> - fprintf_fn (stream, sx_tab[(field_b >> 6) & 3]);
> + fprintf_fn (stream, "%s", sx_tab[(field_b >> 6) & 3]);
> break;
> case DSP_REG_Y:
> - fprintf_fn (stream, sy_tab[(field_b >> 4) & 3]);
> + fprintf_fn (stream, "%s", sy_tab[(field_b >> 4) & 3]);
> break;
> case A_MACH:
> fprintf_fn (stream, "mach");
> --
> 1.5.6.5
>
>
>
>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Qemu-devel] [PATCH] sparc: Fix compiler warning (fprintf format string)
2010-04-09 20:49 ` [Qemu-devel] [PATCH] sparc: " Stefan Weil
@ 2010-04-13 22:17 ` Aurelien Jarno
0 siblings, 0 replies; 10+ messages in thread
From: Aurelien Jarno @ 2010-04-13 22:17 UTC (permalink / raw)
To: Stefan Weil; +Cc: QEMU Developers
On Fri, Apr 09, 2010 at 10:49:53PM +0200, Stefan Weil wrote:
> When argument checking is enabled, gcc throws this error:
>
> error: format not a string literal and no format arguments
>
> The patch rewrites the statement to satisfy the compiler.
>
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Thanks, applied.
> ---
> sparc-dis.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/sparc-dis.c b/sparc-dis.c
> index 83a12ae..611e74f 100644
> --- a/sparc-dis.c
> +++ b/sparc-dis.c
> @@ -2778,7 +2778,7 @@ print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
> /* Can't do simple format if source and dest are different. */
> continue;
>
> - (*info->fprintf_func) (stream, opcode->name);
> + (*info->fprintf_func) (stream, "%s", opcode->name);
>
> {
> const char *s;
> --
> 1.5.6.5
>
>
>
>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2010-04-13 22:17 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-09 20:49 [Qemu-devel] [PATCH] microblaze: Fix two format specifiers in disassembler Stefan Weil
2010-04-09 20:49 ` [Qemu-devel] [PATCH] arm: Fix compiler warning (fprintf format string) Stefan Weil
2010-04-13 22:16 ` Aurelien Jarno
2010-04-09 20:49 ` [Qemu-devel] [PATCH] m68k: " Stefan Weil
2010-04-13 22:17 ` Aurelien Jarno
2010-04-09 20:49 ` [Qemu-devel] [PATCH] sh4: " Stefan Weil
2010-04-13 22:17 ` Aurelien Jarno
2010-04-09 20:49 ` [Qemu-devel] [PATCH] sparc: " Stefan Weil
2010-04-13 22:17 ` Aurelien Jarno
2010-04-10 11:44 ` [Qemu-devel] [PATCH] microblaze: Fix two format specifiers in disassembler Thomas Monjalon
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 NNTP newsgroup(s).