This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for builtin strpbrk
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: Patch for builtin strpbrk
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: Tue, 7 Nov 2000 00:15:41 +0000 (GMT)
- cc: <gcc-patches at gcc dot gnu dot org>
On Mon, 6 Nov 2000, Kaveh R. Ghazi wrote:
> It transforms the cases where the second argument is a constant
> string, either "" or "c" where `c' is any one character. I.e.:
>
> > strpbrk(foo, "") -> NULL
I trust that in this case it will evaluate foo for its side effects (i.e.,
it doesn't replicate the bug glibc's strpbrk macro had until recently)....
(There may also be -fcheck-memory-usage issues - i.e., it may need to emit
the Checker calls to check that the string is readable (see
expand_builtin_strlen), since the string still is required by the standard
to be a valid null-terminated string. Though, I don't know whether
there's a version of Checker that works with current GCC, or whether the
-fcheck-memory-usage support is at all bitrotten.)
> > strpbrk(foo, "c") -> strchr(foo, c)
--
Joseph S. Myers
jsm28@cam.ac.uk