Rule 3.4: All uses of the #pragma directive shall be...

6.3 Documentation

Moderators: misra-c, david ward

Post Reply
mshearer123
Posts: 14
Joined: Thu Feb 18, 2010 11:28 am
Company: TME

Rule 3.4: All uses of the #pragma directive shall be...

Post by mshearer123 » Tue Mar 02, 2010 11:32 am

Hi,
What exactly does this rule mean?
How do i document a #pragma?

thanks,

Matt

jbezem
Posts: 20
Joined: Mon Aug 01, 2005 8:24 pm
Company: JB Enterprises
Location: Germany
Contact:

Re: Rule 3.4: All uses of the #pragma directive shall be...

Post by jbezem » Tue Mar 02, 2010 2:54 pm

I always create a list with frequently used pragmas with the rationale for their use, and put a short reference in the C source.
For seldom used pragmas, I put an extensive (§+ line) comment in the source, with the rationale for this single use.
It has satisfied all auditors to date.

FWIW,

Johan
Johan Bezem
Email: [email protected]
Tel: +49 172 5463210
Web: http://www.bezem.de/

mshearer123
Posts: 14
Joined: Thu Feb 18, 2010 11:28 am
Company: TME

Re: Rule 3.4: All uses of the #pragma directive shall be...

Post by mshearer123 » Tue Mar 02, 2010 3:46 pm

cheers Johan,

I'll give that a shot

Matt

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

Re: Rule 3.4: All uses of the #pragma directive shall be...

Post by misra-c » Wed Mar 10, 2010 10:41 am

MISRA is not concerned about the format of the documentation, just that the use (and the justification for the use) of each #pragma directive is recorded.

The method of documentation should be specified in the Software Management Plan (MISRA-C:2004 Section 4.1) and Compliance Matrix (MISRA-C:2004 Section 4.3.1).
---
Posted by and on behalf of
the MISRA C Working Group

Post Reply

Return to “6.3 Documentation”