This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH Replace index() with strchr() in read-rtl.c
Kaveh R. Ghazi 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.
>
> Eh? I'm not asking why the developer *chose* index. Rather I'm
> asking, why didn't libiberty provide it once it became clear his
> system didn't do so. He's converting it to strchr because he got
> failures when using index. How can that be?
> http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01193.html
Well, compile failed with -Werror because there was no prototype found,
since MinGW has no such function, and libiberty.h does not prototype it.
I suspect that release builds would still work.
Aaron W. LaFramboise