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]

Patch installed to #undef tokens before poisoning them.


My recent poison patch caused lots of spurious warnings on linux-gnu:

 > 235 poisoning existing macro `strdup'

 > system.h:597:43: warning: poisoning existing macro "strdup"

Fixed thusly, and installed as "obvious".

		--Kaveh


2001-03-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* system.h (malloc, realloc, calloc, strdup, bzero, bcmp, rindex):
	#undef token before poisoning it.

diff -rup orig/egcs-CVS20010309/gcc/system.h egcs-CVS20010309/gcc/system.h
--- orig/egcs-CVS20010309/gcc/system.h	Fri Mar  9 23:05:21 2001
+++ egcs-CVS20010309/gcc/system.h	Sat Mar 10 17:28:36 2001
@@ -594,10 +594,17 @@ typedef char _Bool;
 
 #if (GCC_VERSION >= 3000)
 
+#undef malloc
+#undef realloc
+#undef calloc
+#undef strdup
  #pragma GCC poison malloc realloc calloc strdup
 
 /* Note: not all uses of `bcopy' and `index' (esp. variable names)
    have been eliminated.  */
+#undef bzero
+#undef bcmp
+#undef rindex
  #pragma GCC poison bzero bcmp rindex
 
 #endif /* GCC >= 3.0 */


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