[previous] 3115 [next] Unrecognized preprocessing directive has been ignored because of conditional inclusion directives.
Preprocessing

The parser has encountered an unrecognised preprocessing directive in a section of code which has been excluded by conditional inclusion directives.

The content of an excluded line of code is irrelevant unless it happens to be one of the preprocessing directives which signal the end of the excluded block. For example, if a section of code beginning with #if, #ifdef or #ifndef is excluded (because the relevant condition is not satisfied), all subsequent code (including preprocessing directives) will be ignored until a #else or a #elif or a #endif directive is encountered. In this context, a simple mistake made in the spelling of a directive (e.g. #els, #ellf, #enbif) will probably not be detected by a compiler but could have serious consequences.

Message 3115 is generated whenever an unrecognized directive is encountered in an excluded block of code

For example:


/*PRQA S 2017,3211,3408 ++*/

#els               /* Message 0899 - this won't compile -it's nonsense ! */

int x;

#if 0

int y;   This is excluded code

#els               /* Message 3115 - this will compile ! */

int z;   ... and so is this ...

#endif


MISRA C:2012 Rules applicable to message 3115:

Rule-20.13  (Required) A line whose first token is # shall be a valid preprocessing directive


See also:

QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0
© 2012 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index Contents