![]() |
![]() |
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:2012 Rules applicable to message 0831:
| Rule-1.2 (Advisory) | Language extensions should not be used |
| Rule-20.2 (Required) | The ', " or \ characters and the /* or // character sequences shall not occur in a header file name |
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 |