* [PATCH] Fix a number of -Wformat-security warnings in gcc/config/*/*
@ 2015-02-13 13:58 David Howells
2015-03-06 16:55 ` Jeff Law
0 siblings, 1 reply; 2+ messages in thread
From: David Howells @ 2015-02-13 13:58 UTC (permalink / raw)
To: gcc-patches; +Cc: dhowells
* config/avr/avr.c (avr_print_operand_address, avr_print_operand): Avoid
-Wformat-security warning.
* config/m68k/m68k.c (print_operand): Likewise.
* config/s390/s390.c (print_operand): Likewise.
* config/tilegx/tilegx.c (tilegx_print_operand): Likewise.
--- gcc/config/avr/avr.c.orig 2015-02-12 16:42:25.915682864 +0000
+++ gcc/config/avr/avr.c 2015-02-12 16:43:12.946934049 +0000
@@ -2107,7 +2107,7 @@ avr_print_operand_address (FILE *file, r
switch (GET_CODE (addr))
{
case REG:
- fprintf (file, ptrreg_to_str (REGNO (addr)));
+ fprintf (file, "%s", ptrreg_to_str (REGNO (addr)));
break;
case PRE_DEC:
@@ -2221,12 +2221,12 @@ avr_print_operand (FILE *file, rtx x, in
else if (code == 'E' || code == 'F')
{
rtx op = XEXP(x, 0);
- fprintf (file, reg_names[REGNO (op) + ef]);
+ fprintf (file, "%s", reg_names[REGNO (op) + ef]);
}
else if (code == 'I' || code == 'J')
{
rtx op = XEXP(XEXP(x, 0), 0);
- fprintf (file, reg_names[REGNO (op) + ij]);
+ fprintf (file, "%s", reg_names[REGNO (op) + ij]);
}
else if (REG_P (x))
{
@@ -2235,7 +2235,7 @@ avr_print_operand (FILE *file, rtx x, in
else if (code == 'r' && REGNO (x) < 32)
fprintf (file, "%d", (int) REGNO (x));
else
- fprintf (file, reg_names[REGNO (x) + abcd]);
+ fprintf (file, "%s", reg_names[REGNO (x) + abcd]);
}
else if (CONST_INT_P (x))
{
--- gcc/config/m68k/m68k.c.orig 2015-02-13 11:29:22.395433678 +0000
+++ gcc/config/m68k/m68k.c 2015-02-13 11:29:29.463468222 +0000
@@ -4469,7 +4469,7 @@ print_operand (FILE *file, rtx op, int l
else if (letter == '/')
asm_fprintf (file, "%R");
else if (letter == '?')
- asm_fprintf (file, m68k_library_id_string);
+ asm_fprintf (file, "%s", m68k_library_id_string);
else if (letter == 'p')
{
output_addr_const (file, op);
--- gcc/config/s390/s390.c.orig 2015-02-12 20:06:35.909940703 +0000
+++ gcc/config/s390/s390.c 2015-02-12 20:06:47.627008105 +0000
@@ -5481,11 +5481,11 @@ print_operand (FILE *file, rtx x, int co
switch (code)
{
case 'C':
- fprintf (file, s390_branch_condition_mnemonic (x, FALSE));
+ fprintf (file, "%s", s390_branch_condition_mnemonic (x, FALSE));
return;
case 'D':
- fprintf (file, s390_branch_condition_mnemonic (x, TRUE));
+ fprintf (file, "%s", s390_branch_condition_mnemonic (x, TRUE));
return;
case 'E':
--- gcc/config/tilegx/tilegx.c.orig 2015-02-12 21:11:36.070847024 +0000
+++ gcc/config/tilegx/tilegx.c 2015-02-12 21:11:42.891875824 +0000
@@ -5397,7 +5397,7 @@ tilegx_print_operand (FILE *file, rtx x,
gcc_unreachable ();
}
- fprintf (file, reg);
+ fprintf (file, "%s", reg);
return;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix a number of -Wformat-security warnings in gcc/config/*/*
2015-02-13 13:58 [PATCH] Fix a number of -Wformat-security warnings in gcc/config/*/* David Howells
@ 2015-03-06 16:55 ` Jeff Law
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2015-03-06 16:55 UTC (permalink / raw)
To: David Howells, gcc-patches
On 02/13/15 06:58, David Howells wrote:
> * config/avr/avr.c (avr_print_operand_address, avr_print_operand): Avoid
> -Wformat-security warning.
> * config/m68k/m68k.c (print_operand): Likewise.
> * config/s390/s390.c (print_operand): Likewise.
> * config/tilegx/tilegx.c (tilegx_print_operand): Likewise.
Normally I'd say this should wait as we're in stage4 and this is not a
regression. But it's scope is limited to those backends... so, OK for
the trunk.
jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-06 16:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-13 13:58 [PATCH] Fix a number of -Wformat-security warnings in gcc/config/*/* David Howells
2015-03-06 16:55 ` Jeff Law
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).