View previous topic :: View next topic |
Author |
Message |
mecej4
Joined: 31 Oct 2006 Posts: 1896
|
Posted: Tue Jan 10, 2023 3:53 pm Post subject: Compiler rejects #include in col-1 of fixed form source file |
|
|
Given a test program source file (fixed form) containing #include directives starting in column-1, FTN95 refuses to compile the file.
Code: | program fppbug
implicit none
#include "size.inc"
print *,NSIZE
end program |
where the included file contains the single line
Code: | integer :: NSIZE = 100 |
FTN95 says:
Code: | ftn95 /CFPP fppbug.f
[FTN95/Win32 Ver. 8.92.0 Copyright (c) Silverfrost Ltd 1993-2022]
ERROR S:\LANG\ftn95\fppbug.F 3: Invalid characters in label field of FIXED format source
ERROR S:\LANG\ftn95\fppbug.F 3: Statement not recognised
ERROR S:\LANG\ftn95\fppbug.F 4: NSIZE must appear in a type declaration because IMPLICIT NONE has been used
3 ERRORS [<FPPBUG> FTN95 v8.92.0]
*** Compilation failed |
The usual convention for C processor directives in fixed form (Fortran 77) source is that the directives start in column-1. For example, see the Sun/Oracle page https://docs.oracle.com/cd/E19205-01/820-4180/man1/fpp.1.html , where it says:
Quote: | All fpp directives start with the hash symbol (#) as the first character on a line. |
I think that it is only the output of the preprocessor that should be required to conform to Fortran-77 rules regarding columns 1-6 and 72-80, not the directives themselves.
--------------------
Note: The example code is silly, but the issue exists with older Fortran 77 packages such as MINUIT from CERN. See, for example, lines 12 to 15 in the file https://github.com/ramos/minuit/blob/master/minuit.F . |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8016 Location: Salford, UK
|
Posted: Tue Jan 10, 2023 5:57 pm Post subject: |
|
|
OK. Thanks. I will take a look at this. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8016 Location: Salford, UK
|
Posted: Thu Jan 12, 2023 4:31 pm Post subject: |
|
|
This bug has now been fixed for the next release of FTN95 (after v8.95). |
|
Back to top |
|
|
|