MISRA Discussion Forums
Rule 3.4: All uses of the #pragma directive shall be... - Printable Version

+- MISRA Discussion Forums (https://forum.misra.org.uk)
+-- Forum: MISRA C (https://forum.misra.org.uk/forumdisplay.php?fid=4)
+--- Forum: MISRA-C: 2004 rules (https://forum.misra.org.uk/forumdisplay.php?fid=17)
+---- Forum: 6.3 Documentation (https://forum.misra.org.uk/forumdisplay.php?fid=30)
+---- Thread: Rule 3.4: All uses of the #pragma directive shall be... (/showthread.php?tid=711)



Rule 3.4: All uses of the #pragma directive shall be... - mshearer123 - 02-03-2010

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

thanks,

Matt


Re: Rule 3.4: All uses of the #pragma directive shall be... - jbezem - 02-03-2010

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


Re: Rule 3.4: All uses of the #pragma directive shall be... - mshearer123 - 02-03-2010

cheers Johan,

I'll give that a shot

Matt


Re: Rule 3.4: All uses of the #pragma directive shall be... - misra-c - 10-03-2010

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).