Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Initialisation of arrays of floats
#1
Rule 9.3 in MISRA C:2012 has an exception which states "An initializer of the form { 0 } may be used to explicitly initialize all elements of an array object or subobject". This means that something of the form is acceptable:

Code:
uint32_t x[3] = { 0 };

When using floating point types is it also acceptable to use something of the form:

Code:
typedef double float64_t;
float64_t array_a[10] = { 0.0 };

-Andy.
<t></t>


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)