Bug 25048 - dummy argument with POINTER attribute
Summary: dummy argument with POINTER attribute
Status: RESOLVED DUPLICATE of bug 14771
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.1.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid
Depends on: 14771
Blocks:
  Show dependency treegraph
 
Reported: 2005-11-26 17:44 UTC by Joost VandeVondele
Modified: 2006-02-09 16:00 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-11-26 19:00:50


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joost VandeVondele 2005-11-26 17:44:38 UTC
using GNU Fortran 95 (GCC) 4.1.0 20051126 (prerelease)  with '-g -pedantic -std=f95', I get a bad / no diagnostic for the following invalid code:

INTEGER, POINTER :: I
CALL S1((I))
CONTAINS
 SUBROUTINE S1(I)
  INTEGER, POINTER ::I
 END SUBROUTINE S1
END
Comment 1 Francois-Xavier Coudert 2005-11-26 19:00:50 UTC
gfortran doesn't issue an error on that one, while we have:

## g95 ##
In file foo.f90:2

CALL S1((I))
          1
Error: Actual argument for 'i' must be a pointer at (1)
## Intel ##
fortcom: Error: foo.f90, line 2: A pointer dummy argument may only be argument associated with a pointer.   [I]
CALL S1((I))
---------^
fortcom: Info: foo.f90, line 4: This variable has not been used.   [I]
 SUBROUTINE S1(I)
---------------^
compilation aborted for foo.f90 (code 1)
## Portland ##
## Sun ##

CALL S1((I))
        ^
"foo.f90", Line = 2, Column = 9: ERROR: Dummy argument "I" has the POINTER attribute.  It requires an actual argument with the POINTER attribute.
Comment 2 Andrew Pinski 2006-01-07 05:34:05 UTC
This looks like another case for PR 14771.
Comment 3 Tobias Schlüter 2006-02-09 16:00:24 UTC
Duplicate as it's automatically fixed by the patch for PR14771

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