The #error
and #warning
features enable code to report warning and error conditions to the compiler for integration with standard compile-time warnings and errors.
The example
#warning Code review needed before check-in #define DEBUG #if DEBUG && RETAIL #error A build can't be both debug and retail! #endif class Class1 {…}
always produces a warning ("Code review needed before check-in
"), and produces an error if the pre-processing identifiers DEBUG
and RETAIL
are both defined.