is File Include Guard applicable/reviewed with Rule 19.4 ?

6.19 Preprocessing Directives

Moderators: misra-c, david ward

Post Reply
edgartorres0523
Posts: 1
Joined: Fri Jul 18, 2014 3:42 am
Company: General Electric

is File Include Guard applicable/reviewed with Rule 19.4 ?

Post by edgartorres0523 » Fri Jul 18, 2014 7:17 pm

Hi team,
First of all, I want to thank you for supporting people with this amazing forum that is very useful , "Thumbs up".

I have the following File Include Guard:
#ifndef _MYHEADER_H_ // beginning
#define _MYHEADER_H_
...
#endif // end

My question is if File Include Guards have to be applicable/reviewed with the MISRA-C:2004 Rule 19.4 ?

Thanks and Best Regards.
edgartorres0523

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

Re: is File Include Guard applicable/reviewed with Rule 19.4

Post by misra-c » Fri Aug 22, 2014 12:34 pm

We agree that it is unclear whether the following line violates rule 19.4.
#define _MYHEADER_H_

The intention was that C macros with empty replacement lists should be permitted, as is shown in the example for rule 19.15
---
Posted by and on behalf of
the MISRA C Working Group

Post Reply

Return to “6.19 Preprocessing Directives”