[cfe-dev] Clang warnings and what to do about them

Tim Northover via cfe-dev cfe-dev at lists.llvm.org
Fri Jun 23 13:45:01 PDT 2017


Hi David,

On 23 June 2017 at 13:23, David Barto via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
> In each case the operand on the left is setting the value of tmp0 which is
> then tested on the right side of the operand. In either case I don’t see how
> the ‘As If’ rule from the standard applies. Shouldn’t execution order left
> to right take precedence in this situation?

I think so, this looks like a bug in the implementation of the warning
to me. Both C and C++ guarantee that the LHS of an || operator is
sequenced before the RHS.

Cheers.

Tim.



More information about the cfe-dev mailing list