That are used on this same .c file in if statements to check values from an uint8_t variable.
And I get following MISRA error :
style: Required A compatible declaration shall be visible when an object or function with external linkage is defined [misra-c2012-8.4]
} BLDC_SENSORS_STATE_e;
^
I guess this is a false positive right ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried your approach but this trigger another rule : misra-c2012-10.4 and I should cast BLDC_SENSORS_0 everytime I use it to compare with an uint8_t var.
Hi,
I would like to discuss this issue before creating a ticket :
In .c file :
That are used on this same .c file in
if
statements to check values from anuint8_t
variable.And I get following MISRA error :
I guess this is a false positive right ?
Removing
BLDC_SENSORS_STATE_e
fix this issue :I usually name my enums as if it were a
typedef
, but it's probably bad practice...Yes if you do not intend to use the variable
BLDC_SENSORS_STATE_e
then do not declare it.maybe this code that declares the type "enum BLDC_SENSORS_STATE_e" is what you want:
Thank you for your answer.
I tried your approach but this trigger another rule : misra-c2012-10.4 and I should cast
BLDC_SENSORS_0
everytime I use it to compare with an uint8_t var.