]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/doc/gcc/gcc-command-options/options-controlling-the-preprocessor.rst
sphinx: copy files from texi2rst-generated repository
[thirdparty/gcc.git] / gcc / doc / gcc / gcc-command-options / options-controlling-the-preprocessor.rst
1 ..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6 .. index:: preprocessor options, options, preprocessor
7
8 .. _preprocessor-options:
9
10 Options Controlling the Preprocessor
11 ************************************
12
13 These options control the C preprocessor, which is run on each C source
14 file before actual compilation.
15
16 If you use the :option:`-E` option, nothing is done except preprocessing.
17 Some of these options make sense only together with :option:`-E` because
18 they cause the preprocessor output to be unsuitable for actual
19 compilation.
20
21 In addition to the options listed here, there are a number of options
22 to control search paths for include files documented in
23 :ref:`directory-options`.
24 Options to control preprocessor diagnostics are listed in
25 :ref:`warning-options`.
26
27 .. include:: ../../../../doc/cppopts.rst
28
29
30 .. option:: -Wp,option
31
32 You can use :option:`-Wp,option` to bypass the compiler driver
33 and pass :samp:`{option}` directly through to the preprocessor. If
34 :samp:`{option}` contains commas, it is split into multiple options at the
35 commas. However, many options are modified, translated or interpreted
36 by the compiler driver before being passed to the preprocessor, and
37 :option:`-Wp` forcibly bypasses this phase. The preprocessor's direct
38 interface is undocumented and subject to change, so whenever possible
39 you should avoid using :option:`-Wp` and let the driver handle the
40 options instead.
41
42 .. option:: -Xpreprocessor {option}
43
44 Pass :samp:`{option}` as an option to the preprocessor. You can use this to
45 supply system-specific preprocessor options that GCC does not
46 recognize.
47
48 If you want to pass an option that takes an argument, you must use
49 :option:`-Xpreprocessor` twice, once for the option and once for the argument.
50
51 .. option:: -no-integrated-cpp
52
53 Perform preprocessing as a separate pass before compilation.
54 By default, GCC performs preprocessing as an integrated part of
55 input tokenization and parsing.
56 If this option is provided, the appropriate language front end
57 (:command:`cc1`, :command:`cc1plus`, or :command:`cc1obj` for C, C++,
58 and Objective-C, respectively) is instead invoked twice,
59 once for preprocessing only and once for actual compilation
60 of the preprocessed input.
61 This option may be useful in conjunction with the :option:`-B` or
62 :option:`-wrapper` options to specify an alternate preprocessor or
63 perform additional processing of the program source between
64 normal preprocessing and compilation.
65
66 .. option:: -flarge-source-files
67
68 Adjust GCC to expect large source files, at the expense of slower
69 compilation and higher memory usage.
70
71 Specifically, GCC normally tracks both column numbers and line numbers
72 within source files and it normally prints both of these numbers in
73 diagnostics. However, once it has processed a certain number of source
74 lines, it stops tracking column numbers and only tracks line numbers.
75 This means that diagnostics for later lines do not include column numbers.
76 It also means that options like :option:`-Wmisleading-indentation` cease to work
77 at that point, although the compiler prints a note if this happens.
78 Passing :option:`-flarge-source-files` significantly increases the number
79 of source lines that GCC can process before it stops tracking columns.