https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96351

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Here is an example without pointers (I think, since int can't overflow, pszTmp
- src should always be > 0):
```


int f(int);

inline unsigned int
stringLen(const int src)
{
    if (src <= 0 || f(src) == 0) {
        return 0;
    } else {
        int pszTmp = src + 1;

        while (f(pszTmp))
            ++pszTmp;

        return (unsigned int)(pszTmp - src);
    }
}

extern void bar();

void foo(int str) {
    unsigned int len = stringLen(str);
    if (!len) {
        bar();
    }
}
```

Reply via email to