[previous] 1045 [next] [E] Use of the #include_next preprocessing directive is a language extension.
Language extensions

The #include_next preprocessing directive is a language extension. It can be used to provide a stub for a Standard Library or a 3rd party header file. This allows parsing of the header file to be altered without having to modify the original file. However, this usage is not portable.

For example:


/*PRQA S 1-9999 ++*/
/*PRQA S 1045 --*/

//
// stddef.h
// a stub that overrides wchar_t definition in stddef.h

typedef unsigned char wchar_t;
#define _WCHAR_T

// include the original header
#include_next <stddef.h>


MISRA-C:2004 Rules applicable to message 1045:

Rule  1.1  (Required) All code shall conform to ISO/IEC 9899:1990 C programming language, ISO 9899, amended and corrected by ISO/IEC 9899/COR1:1995, ISO/IEC 9899/AMD1:1995, and ISO/IEC 9899/COR2: 1996192


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