Rule 2.4 and tag used in typedef

Moderators: misra-c, david ward

Post Reply
lovewar
Posts: 10
Joined: Thu Feb 17, 2011 8:01 am
Company: .

Rule 2.4 and tag used in typedef

Post by lovewar » Fri Oct 30, 2015 9:05 am

Would the following examples be compliant with rule #2.4?

Code: Select all

 typedef struct cood cood_t;
 struct cood {                    // here,  is the tag "cood" compliant?
    uint8_t  id;
 };

michael.metivier
Posts: 10
Joined: Thu Mar 21, 2013 7:30 pm
Company: Gentex, Corp.

Re: Rule 2.4 and tag used in typedef

Post by michael.metivier » Sat Nov 14, 2015 1:03 am

This appears to be nearly identical to my question in http://www.misra.org.uk/forum/viewtopic ... 216&t=1482, and the answer was yes.

misra-c
Posts: 548
Joined: Thu Jan 05, 2006 1:11 pm

Re: Rule 2.4 and tag used in typedef

Post by misra-c » Wed Nov 18, 2015 1:21 pm

The above code is compliant with rule 2.4.
---
Posted by and on behalf of
the MISRA C Working Group

Post Reply

Return to “8.2 Unused code”