Part Number: TM4C129CNCZAD
Tool/software: TI C/C++ Compiler
I have this definition:
const int32_t ACCELERATION_DEFAULT = 0;
const int32_t VELOCITY_DEFAULT = 0;
const uint32_t SUBROUTINE_DEFAULT = 0U;
struct MotorCmd {
MotorCmd_E motor_cmd;
int position;
int32_t acceleration = ACCELERATION_DEFAULT;
int32_t velocity = VELOCITY_DEFAULT;
uint32_t subroutine = SUBROUTINE_DEFAULT;
int32_t torque;
};
I then instantiate this struct in a C++ file like so:
MotorCmd motorHome = {
.motor_cmd = MOTOR_CMD_HOME,
.position = 0,
.torque = 0
};
And the compiler errors out with 1836 for the line with `.torque = 0`. If I comment that single line out, everything is fine. Is this a bug? I don't see why this wouldn't be allowed. As far as I know, `0` is not a non-POD.