Diagnostics - Red Hat ENTERPRISE LINUX 3 - USING CPP Using Instructions

Using cpp, the c preprocessor
Hide thumbs Also See for ENTERPRISE LINUX 3 - USING CPP:
Table of Contents

Advertisement

Chapter 5.

Diagnostics

The directive
causes the preprocessor to report a fatal error. The tokens forming the rest of
#error
the line following
are used as the error message.
#error
You would use
inside of a conditional that detects a combination of parameters which you
#error
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
#ifdef __vax__
#error "Won't work on VAXen.
See comments at get_last_object."
#endif
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
. For example,
#error
#if !defined(UNALIGNED_INT_ASM_OP) && defined(DWARF2_DEBUGGING_INFO)
#error "DWARF2_DEBUGGING_INFO requires UNALIGNED_INT_ASM_OP."
#endif
The directive
is like
, but causes the preprocessor to issue a warning and continue
#warning
#error
preprocessing. The tokens following
are used as the warning message.
#warning
You might use
in obsolete header files, with a message directing the user to the header file
#warning
which should be used instead.
Neither
nor
macro-expands its argument. Internal whitespace sequences are each
#error
#warning
replaced with a single space. The line must consist of complete tokens. It is wisest to make the ar-
gument of these directives be a single string constant; this avoids problems with apostrophes and the
like.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 3

Table of Contents