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

posted @ 2021-10-05 15:46  JayYin  阅读(72)  评论(0编辑  收藏  举报