test-long-names.c fails to build when -Wformat-security is turned on.  Fixed by
the below patch. Alternatives would be to use a plain strcpy, or to turn off the
option in a dg header. Ok to commit, including active branches?

Matthias

gcc/testsuite/

2018-11-26  Matthias Klose  <d...@ubuntu.com>

	* jit.dg/test-long-names.c: Fix build with -Wformat-security.

Index: gcc/testsuite/jit.dg/test-long-names.c
===================================================================
--- gcc/testsuite/jit.dg/test-long-names.c	(revision 266426)
+++ gcc/testsuite/jit.dg/test-long-names.c	(working copy)
@@ -24,7 +24,7 @@
   int i;
 
   /* Begin with the given prefix: */
-  sprintf (buffer, prefix);
+  sprintf (buffer, "%s", prefix);
 
   /* Populate the rest of the buffer with 0123456789 repeatedly: */
   for (i = strlen (prefix); i < NAME_LENGTH - 1; i++)

Reply via email to