On 5 December 2016 at 23:38, Bernd Schmidt <bschm...@redhat.com> wrote: > On 12/05/2016 07:02 PM, Prathamesh Kulkarni wrote: >> >> This patch folds strstr (s, t) eq/ne s to strcmp (s, t) eq/ne 0 if >> strlen (t) is known. > > > That's not the same thing, is it? > > s = "hello world", t = "hello": > strstr (s, t) == s, but not strcmp (s, t) == 0. > > I think you'd want memcmp (s, t, strlen (t)) == 0. Ah indeed! Dunno why I thought strstr (s, t) == strcmp (s, t) :( Thanks for pointing out! > > > Bernd >
- Fold strstr (s, t) eq/ne s to strcmp (s, t) eq/ne 0 if... Prathamesh Kulkarni
- Re: Fold strstr (s, t) eq/ne s to strcmp (s, t) e... Bernd Schmidt
- Re: Fold strstr (s, t) eq/ne s to strcmp (s, ... Prathamesh Kulkarni
- Re: Fold strstr (s, t) eq/ne s to strcmp ... Prathamesh Kulkarni
- Re: Fold strstr (s, t) eq/ne s to strcmp (s, t) e... Jakub Jelinek
- Re: Fold strstr (s, t) eq/ne s to strcmp (s, ... Prathamesh Kulkarni
- Re: Fold strstr (s, t) eq/ne s to strcmp ... Jakub Jelinek
- Re: Fold strstr (s, t) eq/ne s to str... Prathamesh Kulkarni
- Re: Fold strstr (s, t) eq/ne s t... Jakub Jelinek
- Re: Fold strstr (s, t) eq/ne... Prathamesh Kulkarni
- Re: Fold strstr (s, t) e... Jakub Jelinek
- Re: Fold strstr (s, t) e... Prathamesh Kulkarni
- Re: Fold strstr (s, t) e... Jakub Jelinek