Question: ( i ) Can you determine the MISRA C violations in the following example. struct { int 1 6 _ t key; int 1 6

(i) Can you determine the MISRA C violations in the following example.
struct { int16_t key; int16_t value; int8_t counter;} time;
int16_t value;
time.key =10000;
time.counter = time.key;
value =11000;
(ii) Which of these declarations are compliant with MISRA C.
int16_t array1[10];
int8_t array2[]={11,12,13};
int16_t array3[a,b,c]={11,12,13};
int6_t array4[]={34,677,2000,80};
(iii) Which of these declarations are MISRA Ccompliant?
enum colour { red, blue, green, yellow,orange};
enum colour { red=50, blue=49, green, yellow };
(iv) Find the non-compliance in the following section of code
Counter =1;
for ( i =0; i <5; i++)
{
flag++;
i = flag+counter;
flag =0;}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!