Skip to content
RED SAGSkills
hard20 pts · first answer countsembedded-cundefined-behaviour

An overflow check that vanishes

A developer writes this check to detect overflow. What may an optimising compiler legally do with it?

int32_t will_not_overflow(int32_t x) {
  return (x + 1) > x;
}
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions