Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 17.5 and arrays of size 1
Your example is not a violation of rule 17.5. The Amplification states that the argument
Quote:... should point into an object that has at least as many elements as the array.
As you quoted, the C standard states that "&glob" should behave as if it were a pointer to the first element of an array of length one. The expected size in "f" is one, and so the example is compliant.
Posted by and on behalf of the MISRA C Working Group

Messages In This Thread

Forum Jump:

Users browsing this thread: 1 Guest(s)