PATCH Replace index() with strchr() in read-rtl.c

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Mon Sep 13 21:23:00 GMT 2004


 > > Like so?    
 > >
 > > No need for a rindex macro, we already poison it.
 > >
 > > Bootstrapped on sparc-sun-solaris2.7.  It correctly detects
 > >occurances
 > > of index() in read-rtl.c.  (If approved obviously I won't install it
 > > without the necessary fix to read-rtl.c.)
 > 
 > That's certainly what I had in mind.  I'm still worried about system
 > header uses of index (e.g. maybe somebody decided to #define strchr
 > index ...)
 > zw

I find that unlikely, because if some system header #defines strchr to
index, they would also have defined strrchr to rindex.  We've been
poisoning rindex for years, so someone would have hollered by now.

(If you're really worried, I can wrap it in ENABLE_CHECKING so that
for a release no one would be affected.  It would only stop developers
from adding index back on mainline.)

But... since Mark is against it, we can wait until 4.1.

		--Kaveh
--
Kaveh R. Ghazi			ghazi@caip.rutgers.edu



More information about the Gcc-patches mailing list