Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Silencing the checker
#3
I have seen something similar in my travels through time and space but this time using a #pragma directive to silence the checker e.g. when the constants in a table are being initialised in the following way:
Code:
const uint8_t cTable[TABLE_SIZE] = {0, 1, 2, 3 ... };
Rather than changing these to 0U, 1U etc. to comply with Rule 10.6 the programmer had added a #pragma to turn off the tool's warning messages. At least they had added a comment in the code to this effect and I suppose they may have argued that they would document this as per Rule 3.4. However I think this supports JonM's assertion that MISRA C could add some guidance on these "defeat" mechanisms in checkers.
Embedded systems development for over 850 years
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)