gfortran开启preprocessor macros
对于下面的程序,直接用gfortran test.f90
,会有warning,宏也不能生效:test.f90
program main
implicit none
#if 0
write(*,*) "**********"
#endif
end program main
此时编译的时候添加参数-cpp
即可:
gfortran -cpp test.f90
参考:https://gcc.gnu.org/onlinedocs/gfortran/Preprocessing-Options.html