This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problems with '-x f95-cpp-input' and '-pedantic-errors'


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]