![]() |
![]() |
0372 | ![]() |
||||
![]() | |||||||
| ISO C99 Conformance limits | REFERENCE - ISO:C99-5.2.4.1 Translation Limits | ||||||
The translation limits specified in the ISO:C Standard define a minimum set of conditions which a compiler must support in order to be described as conforming. In practice, compilers will often tolerate code which exceeds these minimal requirements. However, in order to ensure portability, it is advisable to avoid writing code that assumes a level of compiler capability which may not always be supported. Message 0372 identifies situations where the nesting level of conditional inclusion directives exceeds 63, the minimum requirement of the ISO:C99 Standard. Message 0828 identifies code which breaches the corresponding ISO:C90 limit, i.e. 8 levels. These messages are not identifying incorrect code but they do identify code which is described in the respective standard as not strictly conforming. For example:
/*PRQA S 2017,3408 ++*/
#define MAC 1000
#if MAC > 0
#if MAC > 10
#if MAC > 20
#if MAC > 30
#if MAC > 40
#if MAC > 50
#if MAC > 60
#if MAC > 70
#if MAC > 80 /* Message 0828 */
#if MAC > 90
#if MAC > 100
#if MAC > 110
#if MAC > 120
#if MAC > 130
#if MAC > 140
#if MAC > 150
#if MAC > 160
#if MAC > 170
#if MAC > 180
#if MAC > 190
#if MAC > 200
#if MAC > 210
#if MAC > 220
#if MAC > 230
#if MAC > 240
#if MAC > 250
#if MAC > 260
#if MAC > 270
#if MAC > 280
#if MAC > 290
#if MAC > 300
#if MAC > 310
#if MAC > 320
#if MAC > 330
#if MAC > 340
#if MAC > 350
#if MAC > 360
#if MAC > 370
#if MAC > 380
#if MAC > 390
#if MAC > 400
#if MAC > 410
#if MAC > 420
#if MAC > 430
#if MAC > 440
#if MAC > 450
#if MAC > 460
#if MAC > 470
#if MAC > 480
#if MAC > 490
#if MAC > 500
#if MAC > 510
#if MAC > 520
#if MAC > 530
#if MAC > 540
#if MAC > 550
#if MAC > 560
#if MAC > 570
#if MAC > 580
#if MAC > 590
#if MAC > 600
#if MAC > 610
#if MAC > 620
#if MAC > 630 /* Message 0372 */
#if MAC > 640
extern void fn(void)
{
}
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
MISRA C:2012 Rules applicable to message 0372:
| Dir-1.1 (Required) | Any implementation-defined behaviour on which the output of the program depends shall be documented and understood |
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 |