Bug 27594 - Warn/Error when number of arguments of a function does not match
Summary: Warn/Error when number of arguments of a function does not match
Status: RESOLVED DUPLICATE of bug 26227
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.2.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-13 22:23 UTC by tobias.burnus
Modified: 2006-05-13 22:25 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tobias.burnus 2006-05-13 22:23:01 UTC
The following testcase has a function with 13 arguments, but 14 are passed.
gfortran-4.2 -Wall does not show a warning.

Other compilers:

NAG's f95 (no options):
Error: test2.f: Wrong number of arguments to TRNS from TEST: 14 found, 13 expected

g95 (Default-on warning):
In file test2.f:19
     &                      ,NCNF1,ACNF1,ICNF1,ACNF2,ICNF2,NORD)
                                                                12
Warning (154): Inconsistent number of arguments in reference to 'trns' at (1) and (2)

Testfile:
----------------------------------
      SUBROUTINE TRNS(NCNF ,ACNF,ICNF,NTRN,ATRN,NORD,AORD,IORD
     &               ,NCNF1,ACNF1,ICNF1,ACNF2,ICNF2)
      PARAMETER(NCNFM=50000,NORDM=100)
      CHARACTER*16 ACNF(NCNFM),ACNF1(NCNFM),ACNF2(NCNFM),AORD(NORDM)
      DIMENSION    ICNF(NCNFM),ICNF1(NCNFM),ICNF2(NCNFM),IORD(NORDM)
      CHARACTER*16 ATRN,AT,AC,APPND
      DIMENSION    IW(100)
      END SUBROUTINE TRNS

      PROGRAM TEST
      IMPLICIT REAL*8 (A-H,O-Z)
      PARAMETER(NCNFM=50000,IUIN=3,IUOUT=1,NORDM=100)
      CHARACTER*16 ACNF(NCNFM),ACNF1(NCNFM),ACNF2(NCNFM),ATRN(100)
     &            ,AORD(NORDM)
      DIMENSION    ICNF(NCNFM),ICNF1(NCNFM),ICNF2(NCNFM),ITRN(100)
     &            ,IORD(NORDM)

              CALL TRNS(NCNF,ACNF,ICNF,ITRN(L),ATRN(L),NORD,AORD,IORD
     &                      ,NCNF1,ACNF1,ICNF1,ACNF2,ICNF2,NORD)
      END PROGRAM TEST
----------------------------------
Comment 1 Andrew Pinski 2006-05-13 22:25:59 UTC
Just a note, I already filed a bug about this.  IFC does not even warn or error out when this happens which does not help people trying to convert their code from IFC to any other good compiler.

*** This bug has been marked as a duplicate of 26227 ***