Yoda Conditions and integer promotion

Viewed 1471

When comparing a type larger than int, with an integer constant, should I place the constant on the left or the right to ensure the correct comparison is performed?

int64_t i = some_val;
if (i == -1)

or should it be:

if (-1 == i)

Are there any circumstances in which either case is not identical to comparison with -1LL (where int64_t is long long)?

1 Answers
Related