]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: ppc: fix printf warnings
authorMike Frysinger <vapier@gentoo.org>
Wed, 30 Jun 2021 01:45:13 +0000 (21:45 -0400)
committerMike Frysinger <vapier@gentoo.org>
Wed, 30 Jun 2021 02:33:04 +0000 (22:33 -0400)
This code hits some format-zero-length warnings, so hack the code
like we did in the common layers.

sim/ppc/ChangeLog
sim/ppc/main.c
sim/ppc/sim_calls.c

index b41d20230d95d52a17e643cedc83c109a05c0232..7a23d68842bd30c6c7f41132d22c485a62a35f90 100644 (file)
@@ -1,3 +1,9 @@
+2021-06-29  Mike Frysinger  <vapier@gentoo.org>
+
+       * main.c (sim_io_error): Add comment
+       * sim_calls.c (sim_io_error): Likewise.  Change "" to " ".
+       (error): Likewise.
+
 2021-06-20  Mike Frysinger  <vapier@gentoo.org>
 
        * Makefile.in (INLINE_CFLAGS): Change to $(SIM_INLINE).
index 0c1a070fc2c22dd1a402f3c2566d3dca5bd03288..2d4d7e40275356048e8676f1820d12036da55075 100644 (file)
@@ -214,6 +214,8 @@ sim_io_flush_stdoutput(void)
   }
 }
 
+/* Glue to use sim-fpu module.  */
+
 void
 sim_io_error (SIM_DESC sd, const char *msg, ...)
 {
index 14d4d6586c78d0a1b8e1c865aa8244c274f36b93..ee9d123b1872bf0458b3494c4eb1619b95896d31 100644 (file)
@@ -372,6 +372,8 @@ sim_io_flush_stdoutput(void)
   }
 }
 
+/* Glue to use sim-fpu module.  */
+
 void
 sim_io_error (SIM_DESC sd, const char *fmt, ...)
 {
@@ -379,7 +381,9 @@ sim_io_error (SIM_DESC sd, const char *fmt, ...)
   va_start(ap, fmt);
   callbacks->evprintf_filtered (callbacks, fmt, ap);
   va_end(ap);
-  callbacks->error (callbacks, "");
+  /* Printing a space here avoids empty printf compiler warnings.  Not ideal,
+     but we want error's side-effect where it halts processing.  */
+  callbacks->error (callbacks, " ");
 }
 
 /****/
@@ -391,7 +395,9 @@ error (const char *msg, ...)
   va_start(ap, msg);
   callbacks->evprintf_filtered (callbacks, msg, ap);
   va_end(ap);
-  callbacks->error (callbacks, "");
+  /* Printing a space here avoids empty printf compiler warnings.  Not ideal,
+     but we want error's side-effect where it halts processing.  */
+  callbacks->error (callbacks, " ");
 }
 
 void *