In C, on the VxWorks operating system, I am experiencing different return values on sizeof
for the same input parameter.
I have only one declaration of a particular structure:
typedef struct Data{
//contains ints, floats, int[], and float[]
} Data;
With two separate spawned tasks, each calling:
sizeof(Data);
the size appears different among the two calls.
One of the values returned back is smaller than it should be.
What could be causing this?
Why would sizeof
return a different number of bytes on the same type declaration?
Despite only having one declaration of the struct, the arrays inside the struct had their size specified by a macro. The macro was re-defined in another file.