This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[avr,trunk,committed]: Fix obvious build warning.


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))
     {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]