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 rejects #include in col-1 of fixed form source file

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



Joined: 31 Oct 2006
Posts: 1838

PostPosted: Tue Jan 10, 2023 3:53 pm    Post subject: Compiler rejects #include in col-1 of fixed form source file Reply with quote

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


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

PostPosted: Tue Jan 10, 2023 5:57 pm    Post subject: Reply with quote

OK. Thanks. I will take a look at this.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Thu Jan 12, 2023 4:31 pm    Post subject: Reply with quote

This bug has now been fixed for the next release of FTN95 (after v8.95).
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