Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"null pointer constant"?
#3
Section 8.11 on page 93 does not intend to gve a precise definition of the C terms, but it is rather included to remind the reader of how C treats pointer conversion.

The MISRA-C working group agrees with the response from Steve Montgomery that (void*)0.0f is not a null pointer constant.

Rule 11.4 is only applicable for conversions between pointer to object and INTEGER type. Only null pointer constants that are integers are covered by this rule as mentioned in the exception. Null pointer constants that have a pointer type are not covered by this rule as they are pointer to incomplete type.

Rule 11.5 is only applicable for conversions from pointer to void to pointer to object. Only null pointer constants that are pointer to void are covered by this rule as mentioned in the exception.

Rule 11.1 is only applicable for conversions between pointer to function and ANY OTHER type. Thus it is applicable to both the integer and pointer forms of the null pointer constant.

Rule 11.2 is only applicable for conversions between pointer to incomplete type and ANY OTHER type. Thus it is applicable to both the integer and pointer forms of the null pointer constant.
Posted by and on behalf of the MISRA C Working Group
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)