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]

[fixinc patch] Fix last failing testcase


This makes the testsuite pass with flying colors.  I couldn't resist a couple
of cosmetic cleanups while I was at it:
[ \t]*[ \t] is equivalent to [ \t]+.
The test looks prettier separated onto two lines.

	* fixinc/inclhack.def (undefine_null):  Don't generate \r characters.
	Prettify a little.
	* fixinc/fixincl.x: Regenerate.

Index: inclhack.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/inclhack.def,v
retrieving revision 1.178
diff -u -r1.178 inclhack.def
--- inclhack.def	27 Aug 2003 02:18:54 -0000	1.178
+++ inclhack.def	27 Aug 2003 02:24:18 -0000
@@ -3442,6 +3442,8 @@
 /*
  *  Fix multiple defines for NULL.  Sometimes, we stumble into \r\n
  *  terminated lines, so accommodate these.  Test both ways.
+ *  Don't bother to reproduce the \r\n termination, as GCC has to
+ *  recognize \n termination anyway.
  */
 fix = {
     hackname  = undefine_null;
@@ -3449,10 +3451,11 @@
     bypass    = "#[ \t]*(ifn|un)def[ \t]+NULL($|[ \t\r])";
 
     c_fix     = format;
-    c_fix_arg = "#ifndef NULL%2\n#define NULL%1%2\n#endif%2\n";
-    c_fix_arg = "^#[ \t]*define[ \t]*[ \t]NULL([^\r\n]+)([\r]*)\n";
+    c_fix_arg = "#ifndef NULL\n#define NULL%1\n#endif\n";
+    c_fix_arg = "^#[ \t]*define[ \t]+NULL([^\r\n]+)[\r]*\n";
 
-    test_text = "#define NULL 0UL\r\n#define NULL\t((void*)0)\n";
+    test_text = "#define NULL 0UL\r\n"
+                "#define NULL\t((void*)0)\n";
 };
 
 /*

-- 
Nathanael Nerode  <neroden at gcc.gnu.org>
http://home.twcny.rr.com/nerode/neroden/fdl.html


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