![]() |
![]() |
0831 | ![]() |
||||
![]() | |||||||
| Language extensions | REFERENCE - ISO:C90-6.1.7 Header Names - Semantics | ||||||
The backslash character \ has been encountered in the specification of a header name in a #include directive. The ISO:C Standard says that if the characters ', \, ", or / followed by * occur in the specification of the header name in a #include directive, the result is undefined. (It is therefore not possible for an escape sequence to be supplied as part of a header name.) QAC will recognise the backslash character as a path separator character in a PC environment but will generate message 0831 to identify the fact that this is an extension to the C language. Specifying paths for header files should be avoided where possible, but if they have to be specified , a Unix style path separator '/' will result in more portable code. For example:
/*PRQA S 553,816,862 EOF*/
#include ".\pcpath\head.h" /* Message 0831 */
MISRA-C:2004 Rules applicable to message 0831:
| 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 |
| Rule 19.2 (Advisory) | Non-standard characters should not occur in header file names in #include directives. |
See also:
![]() | ||
| 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 |