diff mbox

Fix -Wformat-security warning in arm.c

Message ID CAB=4xhrc7hiY7dNw7YnM1ukkPqV_Aabi7U1NrWeFkc9bi=wq7Q@mail.gmail.com
State New
Headers show

Commit Message

Roland McGrath March 25, 2013, 6:34 p.m. UTC
This fixes a gratuitous warning.


Thanks,
Roland


gcc/
2013-03-25  Roland McGrath  <mcgrathr@google.com>

	* config/arm/arm.c (arm_print_operand: case 'w'): Use fputs rather
	than fprintf with a non-constant, non-format string.

Comments

Ian Lance Taylor March 26, 2013, 12:28 a.m. UTC | #1
On Mon, Mar 25, 2013 at 11:34 AM, Roland McGrath <mcgrathr@google.com> wrote:

> gcc/
> 2013-03-25  Roland McGrath  <mcgrathr@google.com>
>
>         * config/arm/arm.c (arm_print_operand: case 'w'): Use fputs rather
>         than fprintf with a non-constant, non-format string.

This is OK.

Thanks.

Ian
Roland McGrath March 26, 2013, 4:43 p.m. UTC | #2
Committed to trunk.

Thanks,
Roland
Matthew Gretton-Dann April 3, 2013, 1:48 p.m. UTC | #3
Is it okay for this patch to be backported to the 4.8 branch?

Thanks,

Matt

On 25/03/13 18:34, Roland McGrath wrote:
> This fixes a gratuitous warning.
>
>
> Thanks,
> Roland
>
>
> gcc/
> 2013-03-25  Roland McGrath  <mcgrathr@google.com>
>
> 	* config/arm/arm.c (arm_print_operand: case 'w'): Use fputs rather
> 	than fprintf with a non-constant, non-format string.
>
> --- a/gcc/config/arm/arm.c
> +++ b/gcc/config/arm/arm.c
> @@ -17997,7 +17997,7 @@ arm_print_operand (FILE *stream, rtx x, int code)
>   	      "wC12",  "wC13",  "wC14",  "wC15"
>   	    };
>
> -	  fprintf (stream, wc_reg_names [INTVAL (x)]);
> +	  fputs (wc_reg_names [INTVAL (x)], stream);
>   	}
>         return;
>
Richard Biener April 3, 2013, 1:57 p.m. UTC | #4
On Wed, 3 Apr 2013, Matthew Gretton-Dann wrote:

> Is it okay for this patch to be backported to the 4.8 branch?

Yes.

Richard.

> Thanks,
> 
> Matt
> 
> On 25/03/13 18:34, Roland McGrath wrote:
> > This fixes a gratuitous warning.
> > 
> > 
> > Thanks,
> > Roland
> > 
> > 
> > gcc/
> > 2013-03-25  Roland McGrath  <mcgrathr@google.com>
> > 
> > 	* config/arm/arm.c (arm_print_operand: case 'w'): Use fputs rather
> > 	than fprintf with a non-constant, non-format string.
> > 
> > --- a/gcc/config/arm/arm.c
> > +++ b/gcc/config/arm/arm.c
> > @@ -17997,7 +17997,7 @@ arm_print_operand (FILE *stream, rtx x, int code)
> >   	      "wC12",  "wC13",  "wC14",  "wC15"
> >   	    };
> > 
> > -	  fprintf (stream, wc_reg_names [INTVAL (x)]);
> > +	  fputs (wc_reg_names [INTVAL (x)], stream);
> >   	}
> >         return;
> > 
> 
> 
>
Roland McGrath April 3, 2013, 6:03 p.m. UTC | #5
Backport committed to gcc-4_8-branch.
diff mbox

Patch

--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -17997,7 +17997,7 @@  arm_print_operand (FILE *stream, rtx x, int code)
 	      "wC12",  "wC13",  "wC14",  "wC15"
 	    };

-	  fprintf (stream, wc_reg_names [INTVAL (x)]);
+	  fputs (wc_reg_names [INTVAL (x)], stream);
 	}
       return;