This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[avr,trunk,committed]: Fix obvious build warning.
- From: Georg-Johann Lay <avr at gjlay dot de>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Denis Chertykov <chertykov at gmail dot com>
- Date: Mon, 20 Jun 2016 12:54:56 +0200
- Subject: [avr,trunk,committed]: Fix obvious build warning.
- Authentication-results: sourceware.org; auth=none
http://gcc.gnu.org/r237588
Installed the following obvious patch to fix "format not a string literal and
no format arguments [-Wformat-security]" build warning.
Johann
* config/avr/avr.c (avr_print_operand): Fix "format not a string
literal" build warnings.
(avr_print_operand_address): Dito.
Index: config/avr/avr.c
===================================================================
--- config/avr/avr.c (revision 237587)
+++ config/avr/avr.c (working copy)
@@ -2170,7 +2170,7 @@ avr_print_operand_address (FILE *file, m
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:
@@ -2284,12 +2284,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))
{
@@ -2298,7 +2298,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))
{