When using pFUnit (3.2.9) to test my Fortran code, I get many "Illegal preprocessor directive" warnings, e.g.
Warning: Illegal preprocessor directive
/path/to/my/file/test.f90:37:2:
#line 26 "/path/to/my/file/test.f90"
1
The code compiles and runs fine, so I would like to turn off these warnings, while still seeing other compiler warnings. Which gfortran compiler flag turns this specific warning off? I am working with gfortran 7.3.1.
This is not the kind of warning that one should turn off because not using a preprocessor has usually very bad consequences on codes that use the most common directives like #define
and #if
. And as far as I know it isn't possible to turn it off.
It is much wiser to enable the preprocessor using the -cpp
flag. Not only the warnings will stop but you will get the correct line numbers in further diagnostics as well, the line numbers will refer to your original code.