MISRA Discussion Forums

Full Version: Rule 3.4: All uses of the #pragma directive shall be...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
What exactly does this rule mean?
How do i document a #pragma?

thanks,

Matt
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
cheers Johan,

I'll give that a shot

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