[previous] MISRA-C:2004  Rule  3.4:  (Required) [next] All uses of the #pragma directive shall be documented and explained.
This rule places a requirement on the user of this standard to produce a list of any pragmas they choose to use in an application. The meaning of each pragma shall be documented. There shall be sufficient supporting description to demonstrate that the behaviour of the pragma, and its implications for the application, have been fully understood.

Any use of pragmas should be minimised, localised and encapsulated within dedicated functions wherever possible.

Example Code:


#include "misra.h"
#include "m2cmex.h"

#pragma push        /* MISRA Violation, unless configured in QAC */

#pragma pop         /* MISRA Violation, unless configured in QAC */

extern S16 test_0304( void )
{
   return 0;
}


QAC messages that encompass this guideline:

3116 Unrecognized #pragma arguments '%s' This #pragma directive has been ignored.



(c) The Motor Industry Research Association, 2004
QA C Source Code Analyser 8.1.2
MISRA-C:2004 Compliance Module 3.2
© 2013 Programming Research
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index Contents