Patchwork Fix -Wformat-security warning in arm.c

login
register
mail settings
Submitter Roland McGrath
Date March 25, 2013, 6:34 p.m.
Message ID <CAB=4xhrc7hiY7dNw7YnM1ukkPqV_Aabi7U1NrWeFkc9bi=wq7Q@mail.gmail.com>
Download mbox | patch
Permalink /patch/230963/
State New
Headers show

Comments

Roland McGrath - March 25, 2013, 6:34 p.m.
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.
Ian Taylor - March 26, 2013, 12:28 a.m.
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.
Committed to trunk.

Thanks,
Roland
Matthew Gretton-Dann - April 3, 2013, 1:48 p.m.
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 Guenther - April 3, 2013, 1:57 p.m.
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.
Backport committed to gcc-4_8-branch.

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;