Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 10.3, conversion of constant expression
#2
Code:
#include
extern uint8_t x;

void foo(void)
{
  switch (x)
  {
  case -1:/*violates 10.3 -> as a result, this case is unreachable code because of silent integer promotion*/
    break;
  }
}
<t></t>


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)