Fix warnings in empty automaton

Andreas Jaeger aj@suse.de
Tue May 7 11:36:00 GMT 2002


Compiling mainline for i686-linux-gnu I got these warnings:

insn-attrtab.c:42278: warning: unused variable `temp'
insn-attrtab.c:42276: warning: unused parameter `chip'
insn-attrtab.c:42300: warning: unused variable `temp'
insn-attrtab.c:42298: warning: unused parameter `chip'

The appended patch fixes the warnings, bootstrapped/regtested on
i686-linux-gnu.

Ok to commit?

Andreas

2002-05-07  Andreas Jaeger  <aj@suse.de>

	* genautomata.c (output_internal_min_issue_delay_func): Add
	ATTRIBUTE_UNUSED to avoid warning with empty dfa.
	(output_internal_trans_func): Likewise.

============================================================
Index: gcc/genautomata.c
--- gcc/genautomata.c	6 May 2002 20:14:32 -0000	1.9
+++ gcc/genautomata.c	7 May 2002 13:20:36 -0000
@@ -7741,11 +7741,11 @@ output_internal_min_issue_delay_func ()
   fprintf (output_file, "static int %s PARAMS ((int, struct %s *));\n",
 	   INTERNAL_MIN_ISSUE_DELAY_FUNC_NAME, CHIP_NAME);
   fprintf (output_file,
-	   "static int\n%s (%s, %s)\n\tint %s;\n\tstruct %s *%s;\n",
+	   "static int\n%s (%s, %s)\n\tint %s;\n\tstruct %s *%s  ATTRIBUTE_UNUSED;\n",
 	   INTERNAL_MIN_ISSUE_DELAY_FUNC_NAME, INTERNAL_INSN_CODE_NAME,
 	   CHIP_PARAMETER_NAME, INTERNAL_INSN_CODE_NAME, CHIP_NAME,
 	   CHIP_PARAMETER_NAME);
-  fprintf (output_file, "{\n  int %s;\n  int %s;\n",
+  fprintf (output_file, "{\n  int %s ATTRIBUTE_UNUSED;\n  int %s;\n",
 	   TEMPORARY_VARIABLE_NAME, RESULT_VARIABLE_NAME);
   fprintf (output_file, "\n  switch (%s)\n    {\n", INTERNAL_INSN_CODE_NAME);
   output_insn_code_cases (output_automata_list_min_issue_delay_code);
@@ -7858,11 +7858,11 @@ output_internal_trans_func ()
   fprintf (output_file, "static int %s PARAMS ((int, struct %s *));\n",
 	   INTERNAL_TRANSITION_FUNC_NAME, CHIP_NAME);
   fprintf (output_file,
-	   "static int\n%s (%s, %s)\n\tint %s;\n\tstruct %s *%s;\n",
+	   "static int\n%s (%s, %s)\n\tint %s;\n\tstruct %s *%s  ATTRIBUTE_UNUSED;\n",
 	   INTERNAL_TRANSITION_FUNC_NAME, INTERNAL_INSN_CODE_NAME,
 	   CHIP_PARAMETER_NAME, INTERNAL_INSN_CODE_NAME,
 	   CHIP_NAME, CHIP_PARAMETER_NAME);
-  fprintf (output_file, "{\n  int %s;\n", TEMPORARY_VARIABLE_NAME);
+  fprintf (output_file, "{\n  int %s ATTRIBUTE_UNUSED;\n", TEMPORARY_VARIABLE_NAME);
   fprintf (output_file, "\n  switch (%s)\n    {\n", INTERNAL_INSN_CODE_NAME);
   output_insn_code_cases (output_automata_list_transition_code);
   fprintf (output_file, "\n    default:\n      return -1;\n    }\n");


-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj



More information about the Gcc-patches mailing list