5.8 and external identifiers in different header file

Moderators: misra-c, david ward

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

5.8 and external identifiers in different header file

Post by lovewar » Tue Aug 25, 2015 2:39 am

Would the following examples be non-compliant with rule #5.8?

Code: Select all

/* file 1. h */
extern int32_t count;    
extern void foo(void);

/* file 2.h */
extern int32_t count;   // here
extern void zoo(void);

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

Re: 5.8 and external identifiers in different header file

Post by misra-c » Fri Sep 18, 2015 1:12 pm

Both declarations of count are of the same object and therefore rule 5.8 does not apply.
However rule 8.5 will be violated as the declaration appears in more than one file.
---
Posted by and on behalf of
the MISRA C Working Group

Post Reply

Return to “8.5 Identifers”