Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consecutive common block syntax - semantic error #3110

Open
Tracked by #661
ivan-pi opened this issue Jan 13, 2024 · 0 comments · May be fixed by #5811
Open
Tracked by #661

Consecutive common block syntax - semantic error #3110

ivan-pi opened this issue Jan 13, 2024 · 0 comments · May be fixed by #5811
Assignees

Comments

@ivan-pi
Copy link

ivan-pi commented Jan 13, 2024

MWE based upon the Netlib code praxis (https://netlib.org/opt/praxis):

      REAL*8 FUNCTION PRAXIS()
      COMMON /GLOBAL/ FX,LDT,DMIN,NF,NL
     .       /Q/ V,Q0,Q1,QA,QB,QC,QD0,QD1,QF1
      RETURN
      END
      SUBROUTINE MIN()
      COMMON /GLOBAL/ FX,LDT,DMIN,NF,NL
     .       /Q/ V,Q0,Q1,QA,QB,QC,QD0,QD1,QF1
      RETURN
      END
      REAL*8 FUNCTION FLIN (N,J,L,F,X,NF)
      COMMON /Q/ V,Q0,Q1,QA,QB,QC,QD0,QD1,QF1
      RETURN
      END
      SUBROUTINE QUAD()
      COMMON /GLOBAL/ FX,LDT,DMIN,NF,NL
     .       /Q/ V,Q0,Q1,QA,QB,QC,QD0,QD1,QF1
      RETURN
      END
      SUBROUTINE PRINT()
      COMMON /GLOBAL/ FX,LDT,DMIN,NF,NL
      RETURN
      END

Fails with:

$ lfortran -c --implicit-typing --fixed-form praxis_mwe1.f
semantic error: The order of variables in common block must be same in all programs
 --> praxis_mwe1.f:7:7 - 8:45
  |
7 |          COMMON /GLOBAL/ FX,LDT,DMIN,NF,NL
  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
...
  |
8 |         .       /Q/ V,Q0,Q1,QA,QB,QC,QD0,QD1,QF1
  | ...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 

The syntax with consecutive common blocks,

       COMMON [/[cb]/] nlist [[,]/[cb]/ nlist] 

is described in Oracles's Fortran 77 Language Reference.

@certik certik mentioned this issue Dec 11, 2024
8 tasks
@pjh40 pjh40 self-assigned this Dec 21, 2024
@pjh40 pjh40 linked a pull request Dec 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants