TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
TIOBE - C Coding Standard
Search

Guideline:  C#2Checked automatically with code checker

Synopsis:The #error directive should be used with caution.
Language:C
Severity Level:5
Category:PREPROCESSING


Description:

Its effect can be achieved by the following:

Example:

error: This should not happen

instead of

Example:

#error: This should not happen

Although both methods will cause an error to be reported by the C compiler, the second form can “choke” a pre-ANSI preprocessor that doesn’t recognise the directive even when the directive is skipped as part of a #if group. The first form will always get through a preprocessor correctly.