Part Number: TMS320F28379D
Tool/software: Code Composer Studio
I have a function that implements a control algorithm. I need a few matrices in this algorithm so I have put their definitions into a header file so that I can alter the matrix initialization values easily. My function then looks like this:
void control_algorithm(int some_inputs)
{
int some_simple_integer_variable;
#include "header_with_matrix_in_it.h"
// Function then does other things without issue...
return;
}
The header file looks like this:
#ifndef HEADER_WITH_MATRIX_IN_IT_H
#define HEADER_WITH_MATRIX_IN_IT_H
static comp_num * H[1];
static comp_num H_row_zero[3] =
{
[0].real = 0,
[0].imag = 0,
[1].real = 1,
[1].imag = 0,
[2].real = 1,
[2].imag = 0,
};
H[0] = H_row_zero;
#endif /* HEADER_WITH_MATRIX_IN_IT_H*/
When I compile with remarks enabled in the compiler flags, I get a remark on everything in the header file saying that a declaration cannot appear after an executable statement. Why is this?
My understanding is that the contents of the .h file are copied verbatim in place of the #include statement before the compiler is even invoked. There are no executable statements before the #include statement.