Programming in C

(Barry) #1
9.0 The Preprocessor 465

In either format, a previously defined name can be supplied and expansion occurs. So
the following sequence works:
#define DATABASE_DEFS </usr/data/database.h>
...
#include DATABASE_DEFS

9.2.7 The#lineDirective
The general format for declaring the #linedirective is as follows:
#line constant "fileName"
This directive causes the compiler to treat subsequent lines in the program as if the name
of the source file were fileName, and as if the line number of all subsequent lines began
at constant. If fileNameis not specified, the filename specified by the last #linedirec-
tive or the name of the source file (if no filename was previously specified) is used.
The #linedirective is primarily used to control the filename and line number that
are displayed whenever an error message is issued by the compiler.

9.2.8 The #pragmaDirective
The general format for declaring the #pragmadirective is as follows:
#pragma text
This causes the preprocessor to perform some implementation-defined action. For
example,
#pragma loop_opt(on)
might cause special loop optimization to be performed on a particular compiler. If this
pragma is encountered by a compiler that doesn’t recognize the loop_optpragma, it is
ignored.
The special keyword STDCis used after the #pragmafor special meaning. Current sup-
ported “switches” that can follow a #pragma STDCare FP_CONTRACT,FENV_ACCESS, and
CX_LIMITED_RANGE.

9.2.9 The #undefDirective
The general format for declaring the #undefdirective is as follows:
#undef identifier
The specified identifierbecomes undefined to the preprocessor. Subsequent #ifdef
or #ifndefdirectives behave as if the identifier were never defined.

9.2.10 The#Directive
This is a null directive and is ignored by the preprocessor.

20 0672326663 AppA 6/10/04 2:01 PM Page 465

Free download pdf