This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch to avoid old-style function definitions in insn-attrtab.c


This patch avoids two instances of old-style function definitions
generated in insn-attrtab.c as shown by the following warnings when
building on ia64-hpux.  In addition to fixing bootstrap warnings it
should also be of use to those building the compiler as C++.

insn-attrtab.c: In function 'get_cpu_unit_code':
insn-attrtab.c:122918: warning: old-style function definition
insn-attrtab.c: In function 'cpu_unit_reservation_p':
insn-attrtab.c:122997: warning: old-style function definition

Bootstrapped with no regressions on ia64-hp-hpux11.22.  OK to commit?

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)

2005-02-18  Joseph S. Myers  <joseph@codesourcery.com>

	* genautomata.c (output_get_cpu_unit_code_func,
	output_cpu_unit_reservation_p): Don't generate old-style function
	definitions.

diff -rupN GCC.orig/gcc/genautomata.c GCC/gcc/genautomata.c
--- GCC.orig/gcc/genautomata.c	2005-02-01 22:41:06.000000000 +0000
+++ GCC/gcc/genautomata.c	2005-02-17 02:09:00.000000000 +0000
@@ -8969,9 +8969,8 @@ output_get_cpu_unit_code_func (void)
   int i;
   unit_decl_t *units;
 
-  fprintf (output_file, "int\n%s (%s)\n\tconst char *%s;\n",
-	   GET_CPU_UNIT_CODE_FUNC_NAME, CPU_UNIT_NAME_PARAMETER_NAME,
-	   CPU_UNIT_NAME_PARAMETER_NAME);
+  fprintf (output_file, "int\n%s (const char *%s)\n",
+	   GET_CPU_UNIT_CODE_FUNC_NAME, CPU_UNIT_NAME_PARAMETER_NAME);
   fprintf (output_file, "{\n  struct %s {const char *%s; int %s;};\n",
 	   NAME_CODE_STRUCT_NAME, NAME_MEMBER_NAME, CODE_MEMBER_NAME);
   fprintf (output_file, "  int %s, %s, %s, %s;\n", CMP_VARIABLE_NAME,
@@ -9018,9 +9017,9 @@ output_cpu_unit_reservation_p (void)
 {
   automaton_t automaton;
 
-  fprintf (output_file, "int\n%s (%s, %s)\n\t%s %s;\n\tint %s;\n",
-	   CPU_UNIT_RESERVATION_P_FUNC_NAME, STATE_NAME,
-	   CPU_CODE_PARAMETER_NAME, STATE_TYPE_NAME, STATE_NAME,
+  fprintf (output_file, "int\n%s (%s %s, int %s)\n",
+	   CPU_UNIT_RESERVATION_P_FUNC_NAME,
+	   STATE_TYPE_NAME, STATE_NAME,
 	   CPU_CODE_PARAMETER_NAME);
   fprintf (output_file, "{\n  gcc_assert (%s >= 0 && %s < %d);\n",
 	   CPU_CODE_PARAMETER_NAME, CPU_CODE_PARAMETER_NAME,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]