Problems with '-x f95-cpp-input' and '-pedantic-errors'
Jerry DeLisle
jvdelisle@verizon.net
Fri Sep 8 13:53:00 GMT 2006
Philippe Schaffnit wrote:
> Hi!
>
> I've tried to send the following mail, but it doesn't seem to show up on
> the list, so I try again, this time with the attachment as plain text,
> which make spoil the effect, though it doesn't seem to for me...
>
> I'm experiencing some problems related to '-x f95-cpp-input' and
> '-pedantic-errors' (or at least I think so...). I'm quite surprised
> because I'm routinely doing very similar things, but this very one has
> been baffling me for several days now, and I can't see anything wrong
> there...
>
> Ideally, I would like to have both '-x f95-cpp-input -pedantic-errors',
> but when I set these two switches I get the following error: 'error: no
> newline at end of file', which I don't seem to be able to get around
> (...), more surprising, if I remove '-pedantic-errors' I get a quite
> long list of errors. To top it, if I remove both switches, everything
> goes smoothly...
>
> I know this is not the best for anyone, but I attach a zip archive with
> a small test case along with three sets of compiler flags ('1': this 'no
> newline at end of file' error, '2': more errors, '3': without these
> flags: much better).
>
> I'm thouroughly lost with that, so if a kind soul could give me some
> hints, it would be greatly appreciated...
>
> Thanks!
>
> Philippe
>
> PS: I'm using quite up-to-date sources: '4.2.0 20060907' (under Linux)
>
>
> gfortran -g -x f95-cpp-input -pedantic-errors Hello.o Test.o -o Test
>
In this line, the '-x f95-cpp-input' is telling the compiler to expect source
files. It is being given two object files (.o). Change the third line to:
gfortran -g -pedantic-errors Hello.o Test.o -o Test
And all will be fine. This third command is not doing any compiling, it is just
linking the two object files into an executable.
Regards,
Jerry
More information about the Fortran
mailing list