[Bug fortran/40006] allow type cheating for procedures with an implicit interface
--- Comment #10 from jv244 at cam dot ac dot uk 2009-08-03 10:06 --- Paul, this one seems fixed as well. I'm closing this. -- jv244 at cam dot ac dot uk changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40006
[Bug fortran/40006] allow type cheating for procedures with an implicit interface
--- Comment #9 from pault at gcc dot gnu dot org 2009-05-12 06:07 --- Since I am working on it, I had better take it :-) Paul -- pault at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |pault at gcc dot gnu dot org |dot org | Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2009-05-12 06:07:43 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40006
[Bug fortran/40006] allow type cheating for procedures with an implicit interface
-- jv244 at cam dot ac dot uk changed: What|Removed |Added Severity|normal |enhancement http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40006
[Bug fortran/40006] allow type cheating for procedures with an implicit interface
--- Comment #1 from rguenth at gcc dot gnu dot org 2009-05-02 13:03 --- The C family of frontends distinguish between different strictness in standard conformance testing (-pedantic, -pedantic-errors, -fpermissive). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40006
[Bug fortran/40006] allow type cheating for procedures with an implicit interface
--- Comment #2 from rguenth at gcc dot gnu dot org 2009-05-02 13:04 --- Note that also one of the SPEC 2006 benchmark fail with -fwhole-file because of type cheating. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40006
[Bug fortran/40006] allow type cheating for procedures with an implicit interface
--- Comment #3 from jv244 at cam dot ac dot uk 2009-05-02 13:16 --- (In reply to comment #2) Note that also one of the SPEC 2006 benchmark fail with -fwhole-file because of type cheating. I would say that I know virtually no large F77 based project that would compile as a single file without an option to relax this checking. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40006
[Bug fortran/40006] allow type cheating for procedures with an implicit interface
--- Comment #4 from jv244 at cam dot ac dot uk 2009-05-02 13:56 --- a further case to hide behind an eventual switch SUBROUTINE S3(a) REAL :: a(*) END SUBROUTINE SUBROUTINE T3(a) REAL, DIMENSION(:) :: a CALL S3(a(1)) END SUBROUTINE T3 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40006
[Bug fortran/40006] allow type cheating for procedures with an implicit interface
--- Comment #5 from dominiq at lps dot ens dot fr 2009-05-02 14:16 --- If I have read correctly the ifort man, ifort does not bounds check this kind of constructs (A(*) or A(1) in procs). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40006
[Bug fortran/40006] allow type cheating for procedures with an implicit interface
--- Comment #6 from jv244 at cam dot ac dot uk 2009-05-02 14:26 --- (In reply to comment #5) If I have read correctly the ifort man, ifort does not bounds check this kind of constructs (A(*) or A(1) in procs). the problem is not bounds, but this: Error: Element of assumed-shaped array passed to dummy argument 'a' at (1) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40006
[Bug fortran/40006] allow type cheating for procedures with an implicit interface
--- Comment #7 from dominiq at lps dot ens dot fr 2009-05-02 14:38 --- the problem is not bounds, but this: Yes, I was just pointing out that ifort accept such cheating in another context. The problem reported by Richard Guenther for the SPEC 2006 benchmark is different as related to a change of kind between the caller and the proc. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40006
[Bug fortran/40006] allow type cheating for procedures with an implicit interface
--- Comment #8 from kargl at gcc dot gnu dot org 2009-05-02 15:37 --- For the code in Comment #1, I get REMOVE:kargl[208] gfc4x -c -O -fwhole-file sa.f90 sa.f90:7.10: call S1(z) 1 Warning: Type mismatch in argument 'z' at (1); passed COMPLEX(4) to REAL(4) sa.f90:17.11: CALL S2(D(1,1),4) 1 Warning: Element of assumed-shaped array passed to dummy argument 'd' at (1) with this patch Index: interface.c === --- interface.c (revision 146793) +++ interface.c (working copy) @@ -1378,9 +1378,16 @@ compare_parameter (gfc_symbol *formal, g !gfc_compare_types (formal-ts, actual-ts)) { if (where) - gfc_error (Type mismatch in argument '%s' at %L; passed %s to %s, - formal-name, actual-where, gfc_typename (actual-ts), - gfc_typename (formal-ts)); + { + if (gfc_option.flag_whole_file) + gfc_warning (Type mismatch in argument '%s' at %L; passed %s to %s, +formal-name, actual-where, gfc_typename (actual-ts), +gfc_typename (formal-ts)); + else + gfc_error (Type mismatch in argument '%s' at %L; passed %s to %s, + formal-name, actual-where, gfc_typename (actual-ts), + gfc_typename (formal-ts)); + } return 0; } @@ -1448,8 +1455,14 @@ compare_parameter (gfc_symbol *formal, g || actual-symtree-n.sym-attr.pointer)) { if (where) - gfc_error (Element of assumed-shaped array passed to dummy - argument '%s' at %L, formal-name, actual-where); + { + if (gfc_option.flag_whole_file) + gfc_warning (Element of assumed-shaped array passed to dummy +argument '%s' at %L, formal-name, actual-where); + else + gfc_error (Element of assumed-shaped array passed to dummy + argument '%s' at %L, formal-name, actual-where); + } return 0; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40006