Bug 27587 - Warn when Scalar constant passed to array dummy argument
Summary: Warn when Scalar constant passed to array dummy argument
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
Depends on:
Reported: 2006-05-13 13:56 UTC by tobias.burnus
Modified: 2006-05-13 23:18 UTC (History)
3 users (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description tobias.burnus 2006-05-13 13:56:03 UTC
Taken from http://www.polyhedron.com/pb05/linux/diagnose.html
      real function same(x)
      implicit none
      real x(1)
      same = x(1)
      program xtwice
      implicit none
      real same
      external same
      print*,'Bug not caught!'

Current behaviour: prints 10.00000
Expected: Warn/error that argument is not an array.

~> gfortran-4.2 -Wall -pedantic -fbounds-check ARG7.F
ARG7.F:34: warning: no newline at end of file
~> ./a.out
 Bug not caught!

Comparison with other compilers:

ifort64-9.1 -C -check all -warn all,nodec,interfaces -gen_interfaces -traceback -fpe0 -fpstkchk ARG7.F
fortcom: Error: ARG7.F, line 31: If the actual argument is scalar, the corresponding dummy argument shall be scalar unless the actual argu
ment is an element of an array that is not an assumed-shape or pointer array, or a substring of such an element.   [X]
compilation aborted for ARG7.F (code 1)

NAG: f95 -C=all -C=undefined -info -g -gline ARG7.F
Error: /tmp/ARG7.022067.f: Argument X (no. 1) in reference to SAME from XTWICE is not an array
[f95 error termination]
Comment 1 Andrew Pinski 2006-05-13 23:18:48 UTC
This is another dup of bug 26227.

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