08-03-2017, 11:06 PM
The MISRA C:2012 guidelines (p. 93) define a "null pointer constant" as
the value 0, optionally cast to void *
Does this allow floating-point zero as a null pointer constant, e. g.
int32_t * pint = (void*)0.0f;
That seems crazy to me, but Rule 11.4 specifically allows a "null pointer constant that has integer type", whereas other mentions (Rules 11.1 and 11.2) omit "integer".
Was the intent to specify an integer zero?
the value 0, optionally cast to void *
Does this allow floating-point zero as a null pointer constant, e. g.
int32_t * pint = (void*)0.0f;
That seems crazy to me, but Rule 11.4 specifically allows a "null pointer constant that has integer type", whereas other mentions (Rules 11.1 and 11.2) omit "integer".
Was the intent to specify an integer zero?
<t></t>