diff mbox

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

Message ID c440bc2b-943b-480b-c6c6-b4c7f4a0baf6@gjlay.de
State New
Headers show

Commit Message

Georg-Johann Lay June 20, 2016, 10:54 a.m. UTC
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.
diff mbox

Patch

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