Preprocessor related options. See section Preprocessing and conditional compilation for more detailed information on preprocessing in gfortran
.
-cpp
-nocpp
.fpp
, .FPP
, .F
, .FOR
, .FTN
, .F90
, .F95
, .F03
or .F08
. Use this option to manually enable preprocessing of any kind of Fortran file. To disable preprocessing of files with any of the above listed extensions, use the negative form: -nocpp
.
The preprocessor is run in traditional mode. Any restrictions of the file-format, especially the limits on line length, apply for preprocessed output as well, so it might be advisable to use the -ffree-line-length-none
or -ffixed-line-length-none
options.
-dM
'#define'
directives for all the macros defined during the execution of the preprocessor, including predefined macros. This gives you a way of finding out what is predefined in your version of the preprocessor. Assuming you have no file foo.f90
, the command touch foo.f90; gfortran -cpp -E -dM foo.f90
will show all the predefined macros.
-dD
-dM
except in two respects: it does not include the predefined macros, and it outputs both the #define
directives and the result of preprocessing. Both kinds of output go to the standard output file. -dN
-dD
, but emit only the macro names, not their expansions. -dU
dD
except that only macros that are expanded, or whose definedness is tested in preprocessor directives, are output; the output is delayed until the use or test of the macro; and '#undef'
directives are also output for macros tested but undefined at the time. -dI
'#include'
directives in addition to the result of preprocessing. -fworking-directory
-fno-working-directory
. If the -P
flag is present in the command line, this option has no effect, since no #line
directives are emitted whatsoever. -idirafter
dir
-I
and the standard system directories have been exhausted. dir is treated as a system include directory. If dir begins with =
, then the =
will be replaced by the sysroot prefix; see --sysroot
and -isysroot
. -imultilib
dir
-iprefix
prefix
-iwithprefix
options. If the prefix represents a directory, you should include the final '/'
. -isysroot
dir
--sysroot
option, but applies only to header files. See the --sysroot
option for more information. -iquote
dir
#include "file"
; they are not searched for #include <file>
, before all directories specified by -I
and before the standard system directories. If dir begins with =
, then the =
will be replaced by the sysroot prefix; see --sysroot
and -isysroot
. -isystem
dir
-I
but before the standard system directories. Mark it as a system directory, so that it gets the same special treatment as is applied to the standard system directories. If dir begins with =
, then the =
will be replaced by the sysroot prefix; see --sysroot
and -isysroot
. -nostdinc
-I
options (and the directory of the current file, if appropriate) are searched. -undef
-A
predicate=
answer
-A-
predicate=
answer
-C
You should be prepared for side effects when using -C
; it causes the preprocessor to treat comments as tokens in their own right. For example, comments appearing at the start of what would be a directive line have the effect of turning that line into an ordinary source line, since the first token on the line is no longer a '#'
.
Warning: this currently handles C-Style comments only. The preprocessor does not yet recognize Fortran-style comments.
-CC
-C
, except that comments contained within macros are also passed through to the output file where the macro is expanded. In addition to the side-effects of the -C
option, the -CC
option causes all C++-style comments inside a macro to be converted to C-style comments. This is to prevent later use of that macro from inadvertently commenting out the remainder of the source line. The -CC
option is generally used to support lint comments.
Warning: this currently handles C- and C++-Style comments only. The preprocessor does not yet recognize Fortran-style comments.
-D
name
1
. -D
name=
definition
'#define'
directive. In particular, the definition will be truncated by embedded newline characters. If you are invoking the preprocessor from a shell or shell-like program you may need to use the shell's quoting syntax to protect characters such as spaces that have a meaning in the shell syntax.
If you wish to define a function-like macro on the command line, write its argument list with surrounding parentheses before the equals sign (if any). Parentheses are meaningful to most shells, so you will need to quote the option. With sh and csh, -D'name(args...)=definition'
works.
-D
and -U
options are processed in the order they are given on the command line. All -imacros file and -include file options are processed after all -D and -U options.
-H
'#include'
stack it is. -P
-U
name
-D
option.
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gfortran/Preprocessing-Options.html