 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
sparge
Joined: 11 Apr 2005 Posts: 371
|
Posted: Fri Mar 19, 2010 7:31 pm Post subject: This is the third compiler bug I have reported this week ... |
|
|
The code below illustrates the third FTN95 v5.50 bug I've reported to ftn95@silverfrost.com this week. To be fair, this one is a variation on the theme of the first one I reported, but I haven't even had either of my first two reports acknowledged yet, and this one is one to beware of, pending an upgrade.
The code below compiles without error, although it does (falsely) offer comment 1036 - The derived-type A has been declared but not used. That's a minor issue.
The major issue is that FTN95 misses the error on the line flagged with the comment "! this minor variant is not" at compile time, and computes without complaining at runtime.
Interestingly, FTN95 does notice an error with the variant statement on the line flagged with the comment " ! this error is correctly diagnosed". The error message - error 945: An array cannot be assigned to the scalar WRONG - is not accurate, because what is being assigned to the scalar WRONG is not an array but syntactical nonsense, but at least an error is correctly diagnosed.
Andy
Code: |
program wrong_answer
integer, parameter :: in_a_dim = 3, in_b_dim = 3
type a
integer in_a (in_a_dim)
end type a
type b
type (a), pointer :: in_b (:) => null ()
end type b
type (b) b_eg
integer ia, ib, wrong
allocate (b_eg% in_b (in_b_dim))
do ia = 1, in_a_dim
do ib = 1, in_b_dim
b_eg% in_b (ib)% in_a (ia) = ia - 1 + (ib - 1)* in_a_dim
end do
end do
wrong = 23
! wrong = wrong + b_eg% in_b (3)% in_a (3) ! this is the correct statement
! wrong = b_eg% in_b% in_a (3) ! this error is correctly diagnosed
wrong = wrong + b_eg% in_b% in_a (3) ! this minor variant is not
stop
end program wrong_answer
|
|
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Sat Mar 20, 2010 7:54 am Post subject: |
|
|
You have lost me here Andy.
I recall a false warning that I thought that I had acknowledged and a couple of other problems that turned out to be a errors in your coding. By the way, none of these problems are related to the latest release.
Anyway, I am off for a few days holiday now and will aim to take a look at this latest problem when I return. |
|
Back to top |
|
 |
sparge
Joined: 11 Apr 2005 Posts: 371
|
Posted: Sat Mar 20, 2010 10:59 am Post subject: |
|
|
Paul,
As regards stuff posted here you are right in that you have replied to them. I didn't claim any of them were compiler bugs, though I maintain that the CEILING-related error in my code also highlights a compiler issue (not diagnosing an incorrectly-typed argument).
But I'm not referring to postings on the forum, I'm referring to emails to (like I said) ftn95@silverfrost.com, which seem normally to be picked up by Robert. And I'm not including two more, older than the last week but within the last few weeks, which Robert did reply to - one being code that caused an access violation, fixed in the transition from 5.40 to 5.50, and the other being code that causes an internal compiler error, which was at least promptly acknowledged.
On the whole, I don't report bugs that clearly are bugs in the forum, I report them to ftn95@silverfrost.com, as per the General-Announcement:
http://forums.silverfrost.com/viewtopic.php?t=26
which does not seem to have been superceded. On this occasion, I did so to vent a bit of frustration. I don't expect to report compiler bugs very often, but I do expect them to be at least acknowledged promptly when I do, or when anyone else does. I certainly don't expect to be reporting a second before the first has been acknowledged, and certainly certainly not a third before the first two have been acknowledged. I appreciate Robert may not be around just now; there are out-of-office facilities to cover that eventuality. Bug reports ought to be rare enough, and valuable enough, to merit at least acknowledgement of receipt by return. I made this point before, a few years ago, after a similar lack of response.
Anyway, I'm not pointing a finger at you. Have a good holiday.
Andy |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Tue Apr 20, 2010 3:34 pm Post subject: |
|
|
You are correct in pointing out this bug in the compiler.
The right hand side does give an array result and this cannot be assigned to a scalar.
I will add this to the list of bugs to be fixed. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Tue Jun 01, 2010 11:27 am Post subject: |
|
|
This bug has now been fixed for the next release. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|