11-09-2013, 07:58 PM
12-09-2013, 08:59 AM
Yes this is compliant.
See Exception 1:
See Exception 1:
Quote:An initializer of the form { 0 } may be used to explicitly initialize all elements of an array object or sub-object.
20-03-2015, 01:23 AM
Would the following examples be compliant with rule #9.3?
Code:
char_t a[5] = { '\0' };
Code:
uint16_t a[3][2] = {0u};
Code:
static uint16_t glob_arr[3] = {0u};
Code:
float32_t a[3][2] = {0.0f};
01-04-2015, 11:49 AM
Your examples are all non compliant. You may either use the { 0 } syntactic form or you can initialise all elements of the array. E.g.
Code:
static uint16_t glob_arr[3] = {0u, 0u, 0u}; /* Compliant - all items initialised */