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 

Compiler error GET_IM_INFO@

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit
View previous topic :: View next topic  
Author Message
DietmarSiepmann



Joined: 03 Jun 2013
Posts: 279

PostPosted: Wed Jan 08, 2020 6:52 pm    Post subject: Compiler error GET_IM_INFO@ Reply with quote

Hello,

the following code results in a compiler error for both the 32 bit and the 64 bit version of ftn95 version 8.60.
Code:

      SUBROUTINE MYSUB (IERR)
      INCLUDE <WINDOWS.INS>
      INTEGER*4 IERR
      INTEGER*4 IERR4
      character*256 MYFILENAME
      character*64 myformat
      integer n
      PARAMETER(n=32)
      integer width(n),height(n),nb_colours(n)
      integer nb_images
      CALL GET_IM_INFO@(MYFILENAME,
     *width(n),height(n),nb_colours(n),
     *nb_images,myformat,IERR)
      end

The problem is the 7th parameter of subroutine GET_IM_INFO@ (IERR). Compiling this code results in the following error messages:
Code:

[FTN95/x64 Ver. 8.60.0 Copyright (c) Silverfrost Ltd 1993-2019]
                ...
0011)       CALL GET_IM_INFO@(MYFILENAME,
0012)      *width(n),height(n),nb_colours(n),
0013)      *nb_images,myformat,IERR)
*** The seventh argument of GET_IM_INFO@ is passed as a reference that should
    not be a constant nor an expression
    1 ERROR  [<MYSUB> FTN95 v8.60.0]
*** Compilation failed

. No object file is generated.

If parameter ierr is substituted by ierr4 when calling GET_IM_INFO@ then the compilation is successful and the corresponding object file is generated for both the 32 bit and the 64 bit version of ftn95 (version 8.60).

Moreover if using version 8.50 of ftn95 then the erronious code above compiles successfully for both the 32 and 64 bit version of ftn95.

Regards,
Dietmar
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Jan 08, 2020 7:32 pm    Post subject: Reply with quote

That is very strange. If the error number is 1244 then it will be the false report described in the ClearWin+ part of this forum.

I plan to take a look at it anyway.

There was no clearwin.ins argument checking in v8.50.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Thu Jan 09, 2020 9:11 am    Post subject: Reply with quote

The error number is indeed 1244 and this is a false error message coming from the new argument checking for clearwin.ins routines.

In this context the checking works correctly with the variable IERR4 which is local. You can use a local variable as a temporary fix until the next release of FTN95 or you can use one of the methods given in http://forums.silverfrost.com/viewtopic.php?t=4135. Or, as a last resort, stay with v8.50 until a new FTN95 is released.
Back to top
View user's profile Send private message AIM Address
DietmarSiepmann



Joined: 03 Jun 2013
Posts: 279

PostPosted: Thu Jan 09, 2020 11:17 am    Post subject: Reply with quote

Paul,

thanks for your hint, I'm fine with /ignore 1244 and this works.

Related to this I observed another similar problem:
Code:

      INCLUDE <WINDOWS.INS>
      INTEGER SAMPLES                                     
      PARAMETER (SAMPLES=16)
      INTEGER*2 LEFT(SAMPLES), RIGHT(SAMPLES)
      INTEGER*4 IERR     
      IERR=PLAY_SOUND@(LEFT,RIGHT,SAMPLES)     
      end

Compiling this with ftn95 version 8.60 and option /ignore 1244 results in error messages mentioned below and does not produce an object file:
Code:

*** The first argument of PLAY_SOUND@ must be of INTEGER(KIND=2) type, not
    INTEGER(KIND=2)
*** The second argument of PLAY_SOUND@ must be of INTEGER(KIND=2) type, not
    INTEGER(KIND=2)
    2 ERRORS  [<main program> FTN95 v8.60.0]
*** Compilation failed
. For ftn95 version 8.51 compilation was successful.
Regards,
Dietmar
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1884

PostPosted: Thu Jan 09, 2020 12:07 pm    Post subject: Reply with quote

Dietmar, I suspect that the 8.60 bug will be seen even if you leave out /ignore 1244 when compiling your seven line subroutine, because the error number for arguments of the incorrect kind is 1240. It may be worthwhile for you to specify /ignore 1240 as an additional option with the 8.60 compiler (personal edition not yet made available).
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Jan 09, 2020 12:31 pm    Post subject: Reply with quote

Yes the error number to ignore is 1240.

The fault is in the new clearwin.ins and the interface for PLAY_SOUND@ (and RECORD_SOUND@). These should contain REFA2 and not REF2. The 'A' is for array and the '2' is for INTEGER(2).

Reverting to an old clearwin.ins (which uses only REF and VAL and does no checking) also "fixes" this fault.
Back to top
View user's profile Send private message AIM Address
DietmarSiepmann



Joined: 03 Jun 2013
Posts: 279

PostPosted: Thu Jan 09, 2020 2:43 pm    Post subject: Reply with quote

Thanks for your quick help, Paul, mecej4,

adding options
Quote:
/ignore 1244 /ignore 1240

to the ftn95 options used in the compile in question helped and made the object file be generated as excpected.

Regards,
Dietmar
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Jan 09, 2020 4:38 pm    Post subject: Reply with quote

"/ignore 1240 1244" also works.
Back to top
View user's profile Send private message AIM Address
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Wed Jan 22, 2020 4:26 pm    Post subject: Reply with quote

mecej4 wrote:
Quote:
Dietmar, I suspect that the 8.60 bug will be seen even if you leave out /ignore 1244


don't you mean:
Quote:
Dietmar, I suspect that the 8.60 bug will be seen even if you include /ignore 1244
?

and doesn't that mean you only need /ignore 1240 , not both ?
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit 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