![]() |
![]() |
0888 | ![]() |
||||
![]() | |||||||
| Explicitly undefined | REFERENCE - ISO:C90-6.8.1 Conditional Inclusion - Semantics | ||||||
This 'defined' operator has been misused. For example:
/*PRQA S 553,2017 ++*/
#if defined(ABC) /* OK */
int a = 1;
#endif
#if defined /* Message 0887 */
int b = 1;
#endif
#if defined ( ) /* Message 0888 and also 0887 and 0897 */
int c = 1;
#endif
#if defined (-X) /* Message 0888 and also 0887 and 0897 */
int d = 1;
#endif
#if defined("filename") /* Message 0888 and also 0887 and 0897 */
int e = 1;
#endif
#if defined 123 /* Message 0887 and also 0897 */
int f = 1;
#endif
MISRA-C:2004 Rules applicable to message 0888:
| Rule 1.2 (Required) | No reliance shall be placed on undefined or unspecified behaviour. |
| Rule 19.14 (Required) | The defined preprocessor operator shall only be used in one of the two standard forms. |
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 |