]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: io: tweak compiler workaround with error output
authorMike Frysinger <vapier@gentoo.org>
Thu, 11 Nov 2021 05:14:46 +0000 (00:14 -0500)
committerMike Frysinger <vapier@gentoo.org>
Thu, 11 Nov 2021 05:16:33 +0000 (00:16 -0500)
Outputting an extra space broke a cris test.  Change the workaround
to use %s with an empty string to avoid the compiler warning but not
output an extra space.

sim/common/sim-io.c

index 7bb504c74296da22c44ff65819a45dddb84fbec9..9fdc79e0301b856f637a192750f374d8439d0fbd 100644 (file)
@@ -308,9 +308,9 @@ sim_io_error (SIM_DESC sd,
     va_start (ap, fmt);
     STATE_CALLBACK (sd)->evprintf_filtered (STATE_CALLBACK (sd), fmt, ap);
     va_end (ap);
-    /* Printing a space here avoids empty printf compiler warnings.  Not ideal,
-       but we want error's side-effect where it halts processing.  */
-    STATE_CALLBACK (sd)->error (STATE_CALLBACK (sd), " ");
+    /* The %s avoids empty printf compiler warnings.  Not ideal, but we want
+       error's side-effect where it halts processing.  */
+    STATE_CALLBACK (sd)->error (STATE_CALLBACK (sd), "%s", "");
   }
 }