Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 5.1 and case-sensitive
#4
The definition of the word "distinct" in rule 5.1 depends on the implementation in which the code is being compiled/linked.
What is considered non-compliant with this rule will depend on the implementation under which the code is being developed, not the implementation of the analysis tool.

The first example in the document (engine_exhaust_gas_temperature_raw) assumes an implementation which supports:
  • 31 significant characters
  • case-sensitive
The second example (abc) assumes an implementation which supports:
  • 6 significant characters
  • case-INsensitive
Because this implementation is case-insensitive, the linker may treat "abc" and "ABC" as the same identifier. Therefore this is non-compliant with rule 5.1.

"abc" v "ABC" would be compliant with rule 5.1 if the implementation treated external identifiers as being case-sensitive.

Note: "abc" and "ABC" will always be non-compliant with directive 4.5.
Posted by and on behalf of the MISRA C Working Group


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)