Recent fixinc cabs addition breaks sunos4 + fix

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Tue May 9 10:59:00 GMT 2000


I'm recently getting an error on SunOS4 caused by the fixincl `cabs'
case introduced recently:

 > In file included from ../../../egcs-CVS20000508/gcc/java/gjavah.c:29:
 > ../include/math.h:330: parse error before `cabs'
 > make[3]: *** [gjavah.o] Error 1

The original math.h file on SunOS4 reads:

 > /*
 >  *      Deprecated functions for compatibility with past.
 >  *      Changes planned for future.
 >  */
 >  
 > extern double cabs();   /* Use double hypot(x,y)
 >                          * Traditional cabs usage is confused -
 >                          * is its argument two doubles or one struct?
 >                          */

The rules in inclhack.def delete the whole line when they find a cabs
match.  As you can see above, this nukes the comment start after the
cabs declaration and leaves the math.h file with a syntax error.

I didn't have autogen handy but the following quick hack to the
generated file fixed it.


--- ../../../../egcs-CVS20000508/gcc/fixinc/fixincl.x	Mon May  8 21:18:37 2000
+++ fixincl.x	Tue May  9 13:49:25 2000
@@ -1292,8 +1292,8 @@ tTestDesc aBroken_CabsTests[] = {
  *  Fix Command Arguments for Broken_Cabs
  */
 const char* apzBroken_CabsPatch[] = { "sed",
-    "-e", "/^extern double cabs();/d",
-    "-e", "/^extern double cabs(struct dbl_hypot);/d",
+    "-e", "s/^extern double cabs();//",
+    "-e", "s/^extern double cabs(struct dbl_hypot);//",
     (char*)NULL };
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * *


Of course the real fix would be to inclhack.def, I was just lazy. :-)
I'll fix that for checkin.  Also, it looks like the convention is to
use a sed regexp line matcher before the "s/", but the fix has a
"select" statement already so it seemed redundant.  I'm not sure what
the prefered style should be.

		--Kaveh
--
Kaveh R. Ghazi			Engagement Manager / Project Services
ghazi@caip.rutgers.edu		Qwest Internet Solutions


More information about the Gcc-patches mailing list