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 putting ansidecl.h in tconfig.h


Since target files are always compiled by gcc, IMHO there's no reason
to write anything other than ISO/GNU C in those files.  Therefore I'd
like to stop including ansidecl.h in tconfig.h which will prevent
using PARAMS, etc. in target files.

I uncovered one case in which a file in used in both host and target
files, gcov-io.h.  So I had to conditionally define stuff in that
header.  Otherwise, it's pretty simple.

Tested via three-staging on sparc-sun-solaris2.7.  It dies building
libstdc++.  But so does an unpatch tree, so it's not related.

Ok to install?

		Thanks,
		--Kaveh


2003-01-23  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* ChangeLog (configure.in): Don't include ansidecl.h in tconfig.h.
	* gcov-io.h (PARAMS, ATTRIBUTE_UNUSED: Define if IN_LIBGCC2.
	* unwind-dw2-fde.h (last_fde): Use __attribute__, not
	ATTRIBUTE_UNUSED.

	* configure: Regenerate.
	
diff -rup orig/egcc-CVS20030123/gcc/configure.in egcc-CVS20030123/gcc/configure.in
--- orig/egcc-CVS20030123/gcc/configure.in	2003-01-21 08:40:11.000000000 -0500
+++ egcc-CVS20030123/gcc/configure.in	2003-01-23 12:02:39.438983470 -0500
@@ -1036,7 +1036,8 @@ tm_file="${tm_file} defaults.h"
 tm_p_file="${tm_p_file} tm-preds.h"
 host_xm_file="auto-host.h ansidecl.h ${host_xm_file}"
 build_xm_file="${build_auto} ansidecl.h ${build_xm_file}"
-xm_file="ansidecl.h ${xm_file}"
+# We don't want ansidecl.h in target files, write code there in ISO/GNU C.
+#xm_file="ansidecl.h ${xm_file}"
 
 # Truncate the target if necessary
 if test x$host_truncate_target != x; then
diff -rup orig/egcc-CVS20030123/gcc/gcov-io.h egcc-CVS20030123/gcc/gcov-io.h
--- orig/egcc-CVS20030123/gcc/gcov-io.h	2002-12-16 16:00:50.000000000 -0500
+++ egcc-CVS20030123/gcc/gcov-io.h	2003-01-23 12:44:43.424875559 -0500
@@ -250,6 +250,15 @@ extern void __gcov_init (struct gcov_inf
 /* Called before fork, to avoid double counting.  */
 extern void __gcov_flush (void);
 
+/* Since this file is used in both host and target files, and we don't
+   include ansidecl.h in target files, provide some necessary macros.  */
+#ifndef PARAMS
+# define PARAMS(X) X
+#endif
+#ifndef ATTRIBUTE_UNUSED
+# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+#endif
+
 #endif /* IN_LIBGCC2 */
 
 /* Functions for reading and writing gcov files.  */
diff -rup orig/egcc-CVS20030123/gcc/unwind-dw2-fde.h egcc-CVS20030123/gcc/unwind-dw2-fde.h
--- orig/egcc-CVS20030123/gcc/unwind-dw2-fde.h	2002-12-30 16:00:11.000000000 -0500
+++ egcc-CVS20030123/gcc/unwind-dw2-fde.h	2003-01-23 12:19:49.419297494 -0500
@@ -166,7 +166,7 @@ next_fde (fde *f)
 extern fde * _Unwind_Find_FDE (void *, struct dwarf_eh_bases *);
 
 static inline int
-last_fde (struct object *obj ATTRIBUTE_UNUSED, fde *f)
+last_fde (struct object *obj __attribute__ ((__unused__)), fde *f)
 {
 #ifdef DWARF2_OBJECT_END_PTR_EXTENSION
   return (char *)f == obj->fde_end || f->length == 0;


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