Synopsis: | Avoid the use of conditional compilation |
Language: | C++ |
Severity Level: | 6 |
Category: | Portability |
Description: |
Conditional compilation makes the flow of control harder to follow, and has ill effects on testability. Platform dependencies should be handled using platform specific shadow files, preferably located in a general platform building-block. exceptions:
An example of the last exception is: #ifdef VXWORKS #pragma SETPLATFORMSPECIFICOPTION #endif |