CPP/GPP in Fortran variadic macro (plus Fortran // concatenation)

老子叫甜甜 提交于 2019-12-01 20:14:40

At least in the context of the simple example described below, I resolved the problem by installing an older cpp. Other research had confirmed that version 4.8 was inserting additional C comments into preprocessed Fortran code, which obviously isn't a good thing. The solution was simple, use cpp-4.7.

Installation (on Ubuntu 16.04) was more straightforward than I had anticipated. A simple

sudo apt-get install cpp-4.7
put the necessary executable in /usr/bin/cpp-4.7

and that preprocesses the following examples the way I want.

$ /usr/bin/cpp-4.7 -C -P t.F90
    PRINT *, "Hello" // "Don"
    sum = (myadd(1, 2, 3, 4, 5))  
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!