Re: Preprocess files with gcc/gfortran vs. cpp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Damnit, I was kind-of hoping this would not break compatibility. :(

Then I guess I am forced to use cpp to create my actual sources.

Thanks for the prompt answer!

PS. Are there options to use the C-processor with gfortran?
I tried:
$> gfortran -Xpreprocessor "-x c11-cpp-input" <source>
f951: Error: command line option ‘-x c11-cpp-input’ is valid for the
driver but not for Fortran

hrmph...

2016-02-19 20:30 GMT+01:00 Jonathan Wakely <jwakely.gcc@xxxxxxxxx>:
> On 19 February 2016 at 19:01, Nick Papior wrote:
>> Am I missing some point here?
>> I would have expected gcc/gfortran to use the _same_ preprocessing
>> utility as that provided in cpp?
>
> By default cpp works in C mode, but when invoked by the Fortran
> front-end it runs in a different mode. If you use cpp -x f97-cpp-input
> then it works in F95 mode, and you get results consistent with
> invoking gcc on a .f file, or invoking gfortran.
>
> I don't know why cpp treats C and Fortran input differently, but
> that's why you don't see what you expect.



-- 
Kind regards Nick




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux