![]() |
|
MISRA-C:2004 Rule 19.5: (Required) |
|
||||
![]() | |||||||
Normally, #define directives will be placed near the start of a file, before the first function definition. Normally, #undef directives will not be needed. (see Rule )
Example Code:
#include "misra.h"
#include "m2cmex.h"
#define L 5
#undef L /* MISRA Violation of Rule 19.6 */
extern S16 test_1905( void )
{
#define M 10 /* MISRA Violation of Rule 19.5 */
#undef M /* MISRA Violation of Rule 19.5
and Rule 19.6 */
return 0;
}
QAC messages that encompass this guideline:
| 0842 | Using #define or #undef inside a function. |
|
||
(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 |