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]

Re: Clean ups for error handling


 > From: Zack Weinberg <zack@wolery.cumb.org>
 > 
 > 	* diagnostic.c (trim_filename, fancy_abort): Moved here from
 > 	rtl.c.
 > 	(fatal_function, set_fatal_function): Removed.
 > 	(fatal): Don't prepare for or call the fatal_function.
 > 	(diagnostic_lock, error_recursion): New.
 > 	(diagnostic_for_decl, report_diagnostic): Guard against
 > 	re-entering the error reporting routines.
 > 	(fancy_abort): Assume function is not NULL.
 > 
 > 	* errors.c (fancy_abort): New.  Assume function is not NULL.
 > 	* tradcpp.c (fancy_abort): Assume function is not NULL.
 > 
 > 	* system.h: Provide default definition of __FUNCTION__.
 > 	* rtl.h: Use __FUNCTION__ not __PRETTY_FUNCTION__ throughout.
 > 	Always use __FUNCTION__ in definition of abort.
 > 	* tree.h: Likewise.
 > 	* varray.h: Likewise.
 > 	* toplev.h: Likewise.  Don't prototype set_fatal_function.


With AIX4.1 cc I get:

 > "../../egcs-CVS20000721/gcc/system.h", line 620.9: 1506-188 (S)
 > 	Reserved name __FUNCTION__ cannot be defined as a macro name.
 > make[2]: *** [cppmain.o] Error 1

So I installed the following patch.

Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ChangeLog,v
retrieving revision 1.7185
diff -u -p -r1.7185 ChangeLog
--- ChangeLog	2000/07/21 18:29:14	1.7185
+++ ChangeLog	2000/07/22 14:11:22
@@ -1,3 +1,7 @@
+2000-07-22  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+	* system.h (__FUNCTION__): Wrap definition in #ifndef.
+
 2000-07-21  David Edelsohn  <edelsohn@gnu.org>
 
 	* rs6000.h (SIZE_TYPE): Define.
Index: system.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/system.h,v
retrieving revision 1.75
diff -u -p -r1.75 system.h
--- system.h	2000/07/21 07:10:36	1.75
+++ system.h	2000/07/22 14:11:22
@@ -617,7 +617,9 @@ extern void *alloca (__SIZE_TYPE__);
 
 /* Various error reporting routines want to use __FUNCTION__.  */
 #if (GCC_VERSION < 2007)
+#ifndef __FUNCTION__
 #define __FUNCTION__ "?"
+#endif /* ! __FUNCTION__ */
 #endif
 
 #endif /* __GCC_SYSTEM_H__ */

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