[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gnulib] Re: why no strchr or strrchr?
From: |
Simon Josefsson |
Subject: |
[Bug-gnulib] Re: why no strchr or strrchr? |
Date: |
Mon, 23 Aug 2004 12:24:38 +0200 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) |
Oskar Liljeblad <address@hidden> writes:
> Is there any particular reason strchr and strrchr are not implemented
> in gnulib? autoconf suggests using these tests for strchr and strrchr:
>
> configure.ac:
> AC_HEADER_STDC
> AC_CHECK_FUNCS(strchr strrchr)
>
> header file:
> #if STDC_HEADERS
> # include <string.h>
> #else
> # if !HAVE_STRCHR
> # define strchr index
> # define strrchr rindex
> # endif
> char *strchr (), *strrchr ();
> #endif
>
> So maybe there would be a point implementing it - either as a real
> function or just as strchr.h?
Are there any machines left, that anyone would want to compile
anything on, that _doesn't_ have str(r)chr?
I'd recommend assuming C89 for your project, and stop worrying about
pre-C89 issues. If you know of a platform that lack str(r)chr,
implement them as a module and contribute it. I think the gnulib
maintainers would approve.
Not speaking for the gnulib maintainers,
Simon