]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
jit: fix -Werror=format-overflow= in testsuite [PR103199]
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 11 Nov 2021 23:32:21 +0000 (18:32 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Fri, 12 Nov 2021 13:20:45 +0000 (08:20 -0500)
gcc/jit/ChangeLog:
PR jit/103199
* docs/examples/tut04-toyvm/toyvm.c (toyvm_function_compile):
Increase size of buffer.
* docs/examples/tut04-toyvm/toyvm.cc
(compilation_state::create_function): Likewise.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/jit/docs/examples/tut04-toyvm/toyvm.c
gcc/jit/docs/examples/tut04-toyvm/toyvm.cc

index 8ea716e2d0a127928373517e4128eeed8f84512b..63418f92d14e32135bd9d5284a7da707a7d79a7a 100644 (file)
@@ -561,7 +561,7 @@ toyvm_function_compile (toyvm_function *fn)
   /* Create a block per operation.  */
   for (pc = 0; pc < fn->fn_num_ops; pc++)
     {
-      char buf[16];
+      char buf[100];
       sprintf (buf, "instr%i", pc);
       state.op_blocks[pc] = gcc_jit_function_new_block (state.fn, buf);
     }
index 7e9550159ad1dd27fbab891888aa6c99084bfa06..81c8045af2c4c8c0a0086c50fb380e51fbd26cb1 100644 (file)
@@ -633,7 +633,7 @@ compilation_state::create_function (const char *funcname)
   /* Create a block per operation.  */
   for (int pc = 0; pc < toyvmfn.fn_num_ops; pc++)
     {
-      char buf[16];
+      char buf[100];
       sprintf (buf, "instr%i", pc);
       op_blocks[pc] = fn.new_block (buf);
     }