View previous topic :: View next topic |
Author |
Message |
DietmarSiepmann
Joined: 03 Jun 2013 Posts: 279
|
Posted: Wed Jan 08, 2020 6:52 pm Post subject: Compiler error GET_IM_INFO@ |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Wed Jan 08, 2020 7:32 pm Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Thu Jan 09, 2020 9:11 am Post subject: |
|
|
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 |
|
|
DietmarSiepmann
Joined: 03 Jun 2013 Posts: 279
|
Posted: Thu Jan 09, 2020 11:17 am Post subject: |
|
|
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 |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1886
|
Posted: Thu Jan 09, 2020 12:07 pm Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Thu Jan 09, 2020 12:31 pm Post subject: |
|
|
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 |
|
|
DietmarSiepmann
Joined: 03 Jun 2013 Posts: 279
|
Posted: Thu Jan 09, 2020 2:43 pm Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Thu Jan 09, 2020 4:38 pm Post subject: |
|
|
"/ignore 1240 1244" also works. |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Wed Jan 22, 2020 4:26 pm Post subject: |
|
|
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 ... " |
|
Back to top |
|
|
|