Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Enumeration specifiers
#1
My question is if the code bellow is not compliance with misrac-2004

uint16_t GetSpeed (void);
void IncreaseSpeed (void);
void DecreaseSpeed (void);
void GoodSpeed (void);

enum tagSPEED
{
Low,
Medium,
High
};

void main (void)
{
uint16_t uSpeed;

uSpeed = GetSpeed();

switch (uSpeed)
{
case Low:
IncreaseSpeed();
break;

case Medium:
GoodSpeed (void);
break;

case High:
DecreaseSpeed (void);
break;

default:
break;
}
}

Is there any solution for this case?


Normative reference:
Ansi-Iso-9899-1990 (6.5.2.2)
Misra-c2004 (6.10.3)
<t>Embedded System</t>


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)