[Bug fortran/27613] compile fails with "Unclassifiable statement" error message
theresa dot adelt at greselius dot net
gcc-bugzilla@gcc.gnu.org
Tue May 26 09:00:00 GMT 2009
------- Comment #13 from theresa dot adelt at greselius dot net 2009-05-26 09:00 -------
Subject: Re: compile fails with "Unclassifiable statement" error
mess
Hello!
Thank you so much for answering.
But I think this is not the problem.
I added the '&', but thereupon appeared a syntax error. I think it is because
in FORTRAN you have to use .AND.. So I changed this and now I got the error
with unclassifiable statement again.
[cfd@sm-pc17-linux Fortran-Kram]$ cat prim.f
program prim
! Testet, ob eine gegebene Zahl prim
integer :: kandidat, teiler, rest
kandidat = 7099
do teiler = 2, kandidat - 1
rest = MOD(kandidat, teiler)
if (rest == 0) THEN
write(*,*)kandidat, ' ist nicht Teiler' .AND.
teiler, 'ist ein Teiler'
stop
end if
end do
write(*,*)kandidat, 'ist prim.'
stop
end program prim
[cfd@sm-pc17-linux Fortran-Kram]$ g95 -ffree-form prim.f
In file prim.f:8
write(*,*)kandidat, ' ist nicht Teiler' .AND.
1
Error: Syntax error in expression at (1)
In file prim.f:9
teiler, 'ist ein Teiler'
1
Error: Unclassifiable statement at (1)
Oh, it's a little crazy. Now I recognize, that I've got the syntax error
anyhow. And changing .AND. with & again, I get only the Syntax error:
[cfd@sm-pc17-linux Fortran-Kram]$ cat prim.f
program prim
! Testet, ob eine gegebene Zahl prim
integer :: kandidat, teiler, rest
kandidat = 7099
do teiler = 2, kandidat - 1
rest = MOD(kandidat, teiler)
if (rest == 0) THEN
write(*,*)kandidat, ' ist nicht Teiler' &
teiler, 'ist ein Teiler'
stop
end if
end do
write(*,*)kandidat, 'ist prim.'
stop
end program prim
[cfd@sm-pc17-linux Fortran-Kram]$ g95 -ffree-form prim.f
In file prim.f:9
teiler, 'ist ein Teiler'
1
Error: Syntax error in WRITE statement at (1)
[cfd@sm-pc17-linux Fortran-Kram]$
Do you now what I have made wrong.
I am so happy if anybody could help me.
Greetings,
Theresa
> ------- Comment #12 from tobi at gcc dot gnu dot org 2009-05-19 15:55 -------
>
> Add an ampersand (&)
>
> (In reply to comment #11)
> > write(*,*)kandidat, ' ist nicht Teiler' &
> here ^^
>
> and be sure to read the section on continuation lines in your Fortran text.
>
>
> --
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27613
>
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27613
More information about the Gcc-bugs
mailing list