Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 10.3, conversion of constant expression
#3
Thank you. But I think unreachable code should be detected by Rule 2.1.

What confuses me is the phrase "The conversion .. to the promoted type of the controlling expression".
In this sample code, x is promoted to int(int16_t or int32_t) and -1 is converted to int.

As a result int is assigned to int. It should be compliant.

I may understand if the phrase is "The conversion .. to the essential type of the controlling expression".
<t></t>


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)