Patch for fixinc `sun_catmacro'

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Tue Jun 8 07:19:00 GMT 1999


	I found another problematic diff with SunOS4's egcs-1.1.2
fixincludes vs. that from "gcc-2.96 19990606".  I traced it to a
failure in the Sun_Catmacro fix.  (The snippet below is small enough
that it should be okay to post.) :-)

diff from /usr/include/pixrect.memvar.h:
 > @@ -106,11 +106,7 @@ int	_mprs_skew();
 >  #ifndef	CAT
 >  #undef	IDENT
 >  #define IDENT(x)	x
 > -#ifdef __STDC__ 
 > -#define CAT(a,b) a##b
 > -#else
 >  #define	CAT(a,b)	IDENT(a)b
 > -#endif
 >  #endif
 >  
 >  #define mpr_static(name, w, h, d, image) \



	The problem is the "select" pattern never matches the line in
the header because the parens aren't escaped, thus the fix is never
run.  The patch below fixes it.

Note I used mixed quote styles because I needed to have double quotes
to have \t expanded to a real TAB, but the backslash parens needed
single quotes to do the right thing.

I am not experienced in autogen to know if this was sensible though.
Maybe one could use double quotes around the whole thing and use \\(
instead of \( ?  I didn't test that form though.  Bruce?

	Which ever fix is used, its needed for both trunk and branch.

		--Kaveh




1999-06-07  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* inclhack.def (sun_catmacro): Escape the parens and use single
	quotes around them, but keep double quotes around the \t.


diff -rup orig/egcs-CVS19990606/gcc/fixinc/inclhack.def egcs-CVS19990606/gcc/fixinc/inclhack.def
--- orig/egcs-CVS19990606/gcc/fixinc/inclhack.def	Fri Jun  4 09:06:26 1999
+++ egcs-CVS19990606/gcc/fixinc/inclhack.def	Mon Jun  7 15:53:28 1999
@@ -1392,7 +1392,7 @@ fix = {
 fix = {
     hackname = sun_catmacro;
     files  = pixrect/memvar.h;
-    select = "^#define[ \t]+CAT(a,b)";
+    select = "^#define[ \t]+"'CAT\(a,b\)';
     sed    = "/^#define[ \t]CAT(a,b)/ i\\\n"
                  "#ifdef __STDC__ \\\n"
                  "#define CAT(a,b) a##b\\\n"



More information about the Gcc-patches mailing list