.TH #line "" "" "Preprocessing Directive" "" "(Language/preprocessing)"
.II "line control"
.II "preprocessing directive, reset line number"
.II "line numbering, reset"
.II "reset line number"
.PC "Reset line number"
\fB#line \fInumber newline\fR
\fB#line \fInumber filename newline\fR
\fB#line \fImacros newline\fR
.PP
.B #line
is a preprocessing directive that resets the line number within
a file.
The \*(AS defines the line number as being the number of newline characters
read, plus one.
.PP
.B #line
can take any of three forms.
The first, \fB#line \fInumber\fR, resets the current line number in the source
file to
.IR number .
The second, \fB#line \fInumber filename\fR, resets the line number to
.I number
and changes the name of the file to
.IR filename .
The third, \fB#line \fImacros\fR, contains
macros that have been defined by earlier preprocessing directives.
When the macros have been expanded by the preprocessor,
the \fB#line\fR instruction will then resemble one of the
first two forms and be interpreted appropriately.
.SH "See Also"
.B
C preprocessor
.R
.br
\*(AS, \(sc6.8.4
.SH Notes
Most often,
.B #line
is used to ensure that error messages point to the
correct line in the program's source code.
A program generator may use this directive to associate errors in
generated C code with the original sources.
For example, the
program generator \fByacc\fR uses \fB#line\fR instructions
to link the C code it generates with the \fByacc\fR code written
by the programmer.
