[previous] 0877 [next] [C] '#if' and '#elif' expressions may contain only integral constants.
Constraint violations REFERENCE - ISO:C90-6.8.1 Conditional Inclusion - Constraints

This is a constraint error

The expression in a '#if' or '#elif' directive must be an integral constant expression. Casts, floating constants and string literals are not allowed.

For example:


/*PRQA S 553,2017 ++*/

#define BIGINT 32767

#if (BIGINT > 35.42)          /* Message 0877 */

#endif


#if ("abc")                   /* Message 0877 */

#endif


MISRA C:2012 Rules applicable to message 0877:

Rule-1.1  (Required) The program shall contain no violations of the standard C syntax and constraints, and shall not exceed the implementation's translation limits


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