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]

Re: Patch for builtin strpbrk


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


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