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]

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


On Sep 12, 2004, at 8:10 PM, DJ Delorie wrote:
While I support nuking `index' from GCC sources, I'm just wondering
why it was a problem in the first place.  Shouldn't libiberty have
taken care of supplying the missing function?

libiberty provides both strchr() and index().


The answer to your question lies not in technology, but in history.
Way Back When, Posix wasn't "it" yet, and it was 50/50 whether your OS
had index() (BSD-like) or strchr() (SysV-like), and few had both.
Which one a developer chose depended more on their background than
anything else.

Historical, yes, but It is not just Posix; ANSI/ISO C have defined "strchr"
since 1990. Why are we still supporting "index"?



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