24-10-2017, 01:11 PM
There is no null pointer constant in this example and hence no violation of rule 11.9.
However there is a violation of rule 9.3 since the array is only partially initialized.
Valid initializations would be:
The use of "0" is a special case which is permitted by exception in rule 9.3 and 10.3.
However there is a violation of rule 9.3 since the array is only partially initialized.
Valid initializations would be:
Code:
uint8 myBuffer[ 8 ] = { 0u,0u,0u,0u,0u,0u,0u,0u };
uint8 myBuffer[ 8 ] = { 0 };
Posted by and on behalf of the MISRA C Working Group