]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/fortran/doc/gfc-internals/command-line-options.rst
sphinx: copy files from texi2rst-generated repository
[thirdparty/gcc.git] / gcc / fortran / doc / gfc-internals / command-line-options.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 .. _command-line-options:
7
8 Command-Line Options
9 ********************
10
11 Command-line options for :command:`gfortran` involve four interrelated
12 pieces within the Fortran compiler code.
13
14 The relevant command-line flag is defined in :samp:`lang.opt`, according
15 to the documentation in :ref:`gccint:options`. This is then processed by the overall GCC
16 machinery to create the code that enables :command:`gfortran` and
17 :command:`gcc` to recognize the option in the command-line arguments and
18 call the relevant handler function.
19
20 This generated code calls the ``gfc_handle_option`` code in
21 :samp:`options.cc` with an enumerator variable indicating which option is
22 to be processed, and the relevant integer or string values associated
23 with that option flag. Typically, ``gfc_handle_option`` uses these
24 arguments to set global flags which record the option states.
25
26 The global flags that record the option states are stored in the
27 ``gfc_option_t`` struct, which is defined in :samp:`gfortran.h`.
28 Before the options are processed, initial values for these flags are set
29 in ``gfc_init_option`` in :samp:`options.cc`; these become the default
30 values for the options.