[PATCH/committed] sim: igen: fix format-zero-length warnings

Message ID 20240109022712.5162-1-vapier@gentoo.org
State New
Headers
Series [PATCH/committed] sim: igen: fix format-zero-length warnings |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 warning Patch is already merged
linaro-tcwg-bot/tcwg_gdb_build--master-arm warning Patch is already merged

Commit Message

Mike Frysinger Jan. 9, 2024, 2:27 a.m. UTC
  Fix warnings from calling printf functions with "" which normally
is useless.
---
 sim/igen/gen.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
  

Patch

diff --git a/sim/igen/gen.c b/sim/igen/gen.c
index 2176b603fc59..30cf10770334 100644
--- a/sim/igen/gen.c
+++ b/sim/igen/gen.c
@@ -67,7 +67,11 @@  print_gen_entry_path (const line_ref *line,
       if (table->top->model != NULL)
 	print (line, "%s", table->top->model->name);
       else
-	print (line, "");
+	{
+	  /* We don't want to output things, but we want the side-effects they
+	     might have (e.g. checking line != NULL).  */
+	  print (line, "%s", "");
+	}
     }
   else
     {
@@ -1242,7 +1246,7 @@  gen_entry_expand_insns (gen_entry *table)
 	  print_gen_entry_insns (table, warning,
 				 "was not uniquely decoded",
 				 "decodes to the same entry");
-	  error (NULL, "");
+	  error (NULL, "unrecoverable\n");
 	}
       return;
     }
@@ -1385,7 +1389,7 @@  gen_entry_expand_insns (gen_entry *table)
 		warning (NULL,
 			 ": Applying rule just copied all instructions\n");
 		print_gen_entry_insns (entry, warning, "Copied", NULL);
-		error (NULL, "");
+		error (NULL, "unrecoverable\n");
 	      }
 	  }
       }