Your code is not incorrect, it simply indicates a potential error. this error will not be displayed if compiled with the C ++ compiler, where it will save type information.
The problem is that in C, once you assign an enum value, it becomes an int type. So, as soon as you read from a weekday, its type is now int not Weekday.
A way around the error reported in lint by encoding is to force it to be assigned again from enum in the same way.
void SetWeekday( Info *info, Data* data )
{
switch (Data->Weekday)
{
case MONDAY: info->Weekday = MONDAY;
case TUESDAY: info->Weekday = TUESDAY;
etc...
}
}
lint , , .
( / ..)