Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question on rule 4.1
#1
Hello,

I need to know if my example is compliant :
Code:
int test = 0x1234;
If it's not compliant, can I have some examples to use hexadecimal affectation.

Best regards.
<t></t>
#2
Rule 4.1 only refers to escape sequences. Your example does not contain an escape sequence and is therefore compliant with rule 4.1

Escape sequences may only occur in character constants or string literals. Examples of escape sequences covered by this rule are:
\11 - octal escape sequence denoting a character with numerical value 9
\x12 - hexadecimal escape sequence denoting a character with numerical value 18
Posted by and on behalf of the MISRA C Working Group


Forum Jump:


Users browsing this thread: 2 Guest(s)