Line Control - 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

The C preprocessor informs the C compiler of the location in your source code where each token
came from. Presently, this is just the file name and line number. All the tokens resulting from macro
expansion are reported as having appeared on the line of the source file where the outermost macro
was used. We intend to be more accurate in the future.
If you write a program which generates source code, such as the
want to adjust the preprocessor's notion of the current file name and line number by hand. Parts of
the output from
bison
rest are copied verbatim from
debuggers to be able to refer to
or any such program can arrange this by writing
bison
is a directive that specifies the original line number and source file name for subsequent input in the
current preprocessor input file.
#line
linenum
is a non-negative decimal integer constant. It specifies the line number which should
linenum
be reported for the following line of input. Subsequent lines are counted from
#line
linenum filename
is the same as for the first form, and has the same effect. In addition,
linenum
string constant. The following line and all subsequent lines are reported to come from the file
it specifies, until something else happens to change that.
the normal rules for a string constant: backslash escapes are interpreted. This is different from
.
#include
Previous versions of GNU CPP did not interpret escapes in
the standard requires they be interpreted, and most other compilers do.
#line
anything else
anything else
of the above two forms.
directives alter the results of the
#line
on. Refer to Section 3.7.1 Standard Predefined Macros. They do not have any effect on
idea of the directory containing the current file. This is a change from GCC 2.95. Previously, a file
reading
#line 1 "../src/gram.y"
#include "gram.h"
would search for
gram.h
file would not be searched. In GCC 3.0 and later, the
referring to a different directory.
#line
We made this change because the old behavior caused problems when generated source files were
transported between machines. For instance, it is common practice to ship generated parsers with a
source release, so that people building the distribution do not need to have yacc or Bison installed.
These files frequently have
are generated from scratch, other parts come from a standard parser file. The
's input. You would like compiler error messages and symbolic
bison
's input file.
bison
has three variants:
#line
is checked for macro calls, which are expanded. The result should match one
__FILE__
in
, then the
../src
directives referring to the directory tree of the system where the
#line
directives into the output file.
#line
filename
#line
and
__LINE__
chain; the directory containing the physical source
-I
is not affected by the presence of a
#include
Chapter 6.

Line Control

parser generator, you may
bison
linenum
filename
is interpreted according to
; we have changed it because
predefined macros from that point
#line
.
is a
's
#include

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 3

Table of Contents