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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #4)
> (In reply to dagelf from comment #3)
> > Can you please give me an example of code with the generated machine code
> > where it actually works as a logical AND? 
> > 
> > Because I've tried several versions, and under no circumstances did it
> > function as a binary operator. 
> > 
> > The warning might be improved to state that `&&` is not logical AND.
> 
> int f(int *a, int *b)
> {
>     if (*a && *b)
>       return 1;
>     return 0;
> }

Note in C, && is short cutting that means *a != 0 has to be true before
evaluating *b != 0.

Reply via email to