Strange compiler error/warning flagging [SOLVED]
I encountered two issues regarding compiler error/warning flagging
Issue 1 (fake error flagging)
errors are flagged, but the project is build ok. Yes, I have cleared the error protocol, cleaned the project and rebuilt. The errors randomly occur when referencing fields of a structure, although the structure/variabole definition is accepted and the struct shows up hitting ctrl-space. The fields not’t, however.
TIM_TimeBaseInitTypeDef TIMBaseInitStruct; // ok
TIMBaseInitStruct.TIM_Prescaler = 1; //TIM_Prescaler causes error
TIMBaseInitStruct.TIM_Period = 24000; //TIM_Period causes error
TIM_TimeBaseInit(TIM1, &TIMBaseInitStruct);
TIM_Cmd(TIM1, ENABLE);
there is no include/include path issue, or else everything would be rejected.
Anyways code is happily built.
Issue 2 (fake warnings)
what the heck causes the compiler to flag the example below as syntax error WARNING(!).
All of it. All 3 lines get yellow wiggly lines.
No symbol resolution issues here.
void CPAL_I2C_BERR_UserCallback(CPAL_DevTypeDef pDevInstance) {
NVIC_SystemReset();
}
Just out of interest, I deleted the project, generated a new one, added in my files and *TATA* problem gone. Only to reappear and stick around after some edit/compile cycles in random files.
well, not exactly random. Seems to affect only std_peripheral_lib structures.
The issues are not really destrous (or are they? hell knows what is built in the end).
Anyways they are extremly annoying.
KR Martin.