Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 10.3, conversion of constant expression
#6
Sorry for late reply.

In my understanding both operands are promoted to signed int based on the Integral promotion rule.
When a cotrol expression is "x", case -1: is not reachable.
But if the control expression is "x-1", case -1: is reachable when x is 0.

I still do not understand what kind of risk should be eliminated by the Amplification 2.
Essential type should be discussed in this rule instead of "The conversion .. to the promoted type".
<t></t>


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)