Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Does Rule 11.9 allow indirect expansion from NULL?
#2
rgamble Wrote:Does the following example violate Rule 11.9?
Code:
#define FOO NULL
int32_t *p1 = FOO;
There is a note in rule 11.9 that says:
Quote:a null pointer constant of the form (void*)0 is permitted, whether or not it was expanded from NULL
There is also the following sample code:
Code:
#define MY_NULL_2 (void*)0
if (p2 == MY_NULL_2)/*compliant*/
Given the fact that this is identical with your example after preprocessing stage, logic dictates it cannot be a violation.
<t></t>


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)