[Main]
Title=User-defined Diagnostics
Index=#error, #warning

[Top]
The directive <CODE>#error</CODE> causes the preprocessor to report a fatal
error.  The tokens forming the rest of the line following <CODE>#error</CODE>
are used as the error message.
<BR><BR>
You would use <CODE>#error</CODE> inside of a conditional that detects a
combination of parameters which you know the program does not properly
support.  For example, if you know that the program will not run
properly on a VAX, you might write
<PRE>#ifdef __vax__
#error &quot;Won't work on VAXen.  See comments at get_last_object.&quot;
#endif
</PRE>
If you have several configuration parameters that must be set up by
the installation in a consistent way, you can use conditionals to detect
an inconsistency and report it with <CODE>#error</CODE>.  For example,
<PRE>#if !defined(UNALIGNED_INT_ASM_OP) &amp;&amp; defined(DWARF2_DEBUGGING_INFO)
#error &quot;DWARF2_DEBUGGING_INFO requires UNALIGNED_INT_ASM_OP.&quot;
#endif
</PRE>
The directive <CODE>#warning</CODE> is like <CODE>#error</CODE>, but causes the
preprocessor to issue a warning and continue preprocessing.  The tokens
following <CODE>#warning</CODE> are used as the warning message.
<BR><BR>
You might use <CODE>#warning</CODE> in obsolete header files, with a message
directing the user to the header file which should be used instead.
<BR><BR>
Neither <CODE>#error</CODE> nor <CODE>#warning</CODE> macro-expands its argument.
Internal whitespace sequences are each replaced with a single space.
The line must consist of complete tokens.  It is wisest to make the
argument of these directives be a single string constant; this avoids
problems with apostrophes and the like.
