replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - This is the third compiler bug I have reported this week ...
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

This is the third compiler bug I have reported this week ...

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
sparge



Joined: 11 Apr 2005
Posts: 371

PostPosted: Fri Mar 19, 2010 7:31 pm    Post subject: This is the third compiler bug I have reported this week ... Reply with quote

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
View user's profile Send private message Send e-mail
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Sat Mar 20, 2010 7:54 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
sparge



Joined: 11 Apr 2005
Posts: 371

PostPosted: Sat Mar 20, 2010 10:59 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Tue Apr 20, 2010 3:34 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Tue Jun 01, 2010 11:27 am    Post subject: Reply with quote

This bug has now been fixed for the next release.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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