public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/25087] New: better diagnostic needed
@ 2005-11-26 18:03 jv244 at cam dot ac dot uk
2005-11-27 4:25 ` [Bug fortran/25087] " kargl at gcc dot gnu dot org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: jv244 at cam dot ac dot uk @ 2005-11-26 18:03 UTC (permalink / raw)
To: gcc-bugs
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:
SUBROUTINE s(n)
CHARACTER(LEN=n), EXTERNAL :: a
write(6,*) a(n)
END SUBROUTINE s
FUNCTION a(n)
CHARACTER(LEN=n) :: a
a="1111111"
END FUNCTION a
PROGRAM TEST
CALL S(3)
END PROGRAM TEST
--
Summary: better diagnostic needed
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jv244 at cam dot ac dot uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25087
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/25087] better diagnostic needed
2005-11-26 18:03 [Bug fortran/25087] New: better diagnostic needed jv244 at cam dot ac dot uk
@ 2005-11-27 4:25 ` kargl at gcc dot gnu dot org
2005-11-29 12:00 ` eedelman at gcc dot gnu dot org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: kargl at gcc dot gnu dot org @ 2005-11-27 4:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from kargl at gcc dot gnu dot org 2005-11-27 04:25 -------
Need more details? Are the 3 routines in separate files?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25087
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/25087] better diagnostic needed
2005-11-26 18:03 [Bug fortran/25087] New: better diagnostic needed jv244 at cam dot ac dot uk
2005-11-27 4:25 ` [Bug fortran/25087] " kargl at gcc dot gnu dot org
@ 2005-11-29 12:00 ` eedelman at gcc dot gnu dot org
2005-11-29 12:06 ` [Bug fortran/25087] Error for missing explicit interface needed eedelman at gcc dot gnu dot org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: eedelman at gcc dot gnu dot org @ 2005-11-29 12:00 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from eedelman at gcc dot gnu dot org 2005-11-29 12:00 -------
Reduced testcase:
SUBROUTINE s(n)
CHARACTER(LEN=n), EXTERNAL :: a
write(6,*) a(n)
END SUBROUTINE s
The problem, unless I'm missing something, is that the external function a
would need an explicit interface. From the draft F2003 standard, 12.3.1.1:
"A procedure [...] shall have an explicit interface if it is referenced and
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25087
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/25087] Error for missing explicit interface needed.
2005-11-26 18:03 [Bug fortran/25087] New: better diagnostic needed jv244 at cam dot ac dot uk
2005-11-27 4:25 ` [Bug fortran/25087] " kargl at gcc dot gnu dot org
2005-11-29 12:00 ` eedelman at gcc dot gnu dot org
@ 2005-11-29 12:06 ` eedelman at gcc dot gnu dot org
2006-09-28 11:35 ` fxcoudert at gcc dot gnu dot org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: eedelman at gcc dot gnu dot org @ 2005-11-29 12:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from eedelman at gcc dot gnu dot org 2005-11-29 12:06 -------
(In reply to comment #2)
> Reduced testcase:
>
> SUBROUTINE s(n)
> CHARACTER(LEN=n), EXTERNAL :: a
> write(6,*) a(n)
> END SUBROUTINE s
>
> The problem, unless I'm missing something, is that the external function a
> would need an explicit interface. From the draft F2003 standard, 12.3.1.1:
>
> "A procedure [...] shall have an explicit interface if it is referenced and
>
Sorry, I messed up. Here's what I intended to write:
"A procedure [...] shall have an explicit interface if it is referenced and
[...]
(3) The procedure has a result that
[...]
(c) has a nonassumed type parameter value that is not an initialization
expression"
Ifort 8.1 gives the following error message for this code:
beam:~$ ifort huj.f90
fortcom: Error: huj.f90, line 2: This passed length character name has been
used in an invalid context. [A]
CHARACTER(LEN=n), EXTERNAL :: a
-------------------------------^
--
eedelman at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |diagnostic
Last reconfirmed|0000-00-00 00:00:00 |2005-11-29 12:06:22
date| |
Summary|better diagnostic needed |Error for missing explicit
| |interface needed.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25087
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/25087] Error for missing explicit interface needed.
2005-11-26 18:03 [Bug fortran/25087] New: better diagnostic needed jv244 at cam dot ac dot uk
` (2 preceding siblings ...)
2005-11-29 12:06 ` [Bug fortran/25087] Error for missing explicit interface needed eedelman at gcc dot gnu dot org
@ 2006-09-28 11:35 ` fxcoudert at gcc dot gnu dot org
2006-11-15 18:02 ` patchapp at dberlin dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-09-28 11:35 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from fxcoudert at gcc dot gnu dot org 2006-09-28 11:35 -------
There's a TODO about this in front-end resolve.c. It's a good point to start...
static void
resolve_formal_arglist (gfc_symbol * proc)
{
gfc_formal_arglist *f;
gfc_symbol *sym;
int i;
/* TODO: Procedures whose return character length parameter is not constant
or assumed must also have explicit interfaces. */
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fxcoudert at gcc dot gnu dot
| |org
Last reconfirmed|2005-11-29 12:06:22 |2006-09-28 11:35:17
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25087
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/25087] Error for missing explicit interface needed.
2005-11-26 18:03 [Bug fortran/25087] New: better diagnostic needed jv244 at cam dot ac dot uk
` (3 preceding siblings ...)
2006-09-28 11:35 ` fxcoudert at gcc dot gnu dot org
@ 2006-11-15 18:02 ` patchapp at dberlin dot org
2006-11-15 18:59 ` pault at gcc dot gnu dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: patchapp at dberlin dot org @ 2006-11-15 18:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from patchapp at dberlin dot org 2006-11-15 18:02 -------
Subject: Bug number PR25087
A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-11/msg01058.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25087
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/25087] Error for missing explicit interface needed.
2005-11-26 18:03 [Bug fortran/25087] New: better diagnostic needed jv244 at cam dot ac dot uk
` (4 preceding siblings ...)
2006-11-15 18:02 ` patchapp at dberlin dot org
@ 2006-11-15 18:59 ` pault at gcc dot gnu dot org
2006-11-22 0:05 ` pault at gcc dot gnu dot org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-11-15 18:59 UTC (permalink / raw)
To: gcc-bugs
--
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|NEW |ASSIGNED
Last reconfirmed|2006-09-28 11:35:17 |2006-11-15 18:59:01
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25087
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/25087] Error for missing explicit interface needed.
2005-11-26 18:03 [Bug fortran/25087] New: better diagnostic needed jv244 at cam dot ac dot uk
` (5 preceding siblings ...)
2006-11-15 18:59 ` pault at gcc dot gnu dot org
@ 2006-11-22 0:05 ` pault at gcc dot gnu dot org
2006-11-23 19:14 ` pault at gcc dot gnu dot org
2006-11-23 19:17 ` pault at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-11-22 0:05 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from pault at gcc dot gnu dot org 2006-11-22 00:05 -------
Subject: Bug 25087
Author: pault
Date: Wed Nov 22 00:05:10 2006
New Revision: 119077
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119077
Log:
2006-11-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/25087
* resolve.c (resolve_fl_procedure): Add an error if an external
automatic character length function does not have an explicit
interface.
2006-11-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/25087
* gfortran.dg/auto_char_len_4.f90: New test.
Added:
trunk/gcc/testsuite/gfortran.dg/auto_char_len_4.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25087
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/25087] Error for missing explicit interface needed.
2005-11-26 18:03 [Bug fortran/25087] New: better diagnostic needed jv244 at cam dot ac dot uk
` (6 preceding siblings ...)
2006-11-22 0:05 ` pault at gcc dot gnu dot org
@ 2006-11-23 19:14 ` pault at gcc dot gnu dot org
2006-11-23 19:17 ` pault at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-11-23 19:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from pault at gcc dot gnu dot org 2006-11-23 19:14 -------
Subject: Bug 25087
Author: pault
Date: Thu Nov 23 19:14:05 2006
New Revision: 119132
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119132
Log:
2006-11-23 Paul Thomas <pault@gcc.gnu.org>
PR fortran/25087
* resolve.c (resolve_fl_procedure): Add an error if an external
automatic character length function does not have an explicit
interface.
PR fortran/29652
* interface.c (check_interface1): Use a local value, instead of
the dummy, as the inner iterator over interface symbols.
PR fortran/29820
* trans-array.c (gfc_get_derived_type): Once done, spread the
backend_decl to all identical derived types in all sibling
namespaces.
2006-11-23 Paul Thomas <pault@gcc.gnu.org>
PR fortran/25087
* gfortran.dg/auto_char_len_4.f90: New test.
PR fortran/29652
* gfortran.dg/generic_7.f90: New test.
* gfortran.dg/defined_operators_1.f90: Add new error.
PR fortran/29820
* gfortran.dg/used_types_13.f90: New test.
Added:
branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/auto_char_len_4.f90
branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/generic_7.f90
branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/used_types_13.f90
Modified:
branches/gcc-4_2-branch/gcc/fortran/ChangeLog
branches/gcc-4_2-branch/gcc/fortran/interface.c
branches/gcc-4_2-branch/gcc/fortran/resolve.c
branches/gcc-4_2-branch/gcc/fortran/trans-types.c
branches/gcc-4_2-branch/gcc/testsuite/ChangeLog
branches/gcc-4_2-branch/gcc/testsuite/gfortran.dg/defined_operators_1.f90
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25087
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/25087] Error for missing explicit interface needed.
2005-11-26 18:03 [Bug fortran/25087] New: better diagnostic needed jv244 at cam dot ac dot uk
` (7 preceding siblings ...)
2006-11-23 19:14 ` pault at gcc dot gnu dot org
@ 2006-11-23 19:17 ` pault at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-11-23 19:17 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from pault at gcc dot gnu dot org 2006-11-23 19:17 -------
Fixed on trunk and 4.2
Paul
--
pault at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25087
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2006-11-23 19:17 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-26 18:03 [Bug fortran/25087] New: better diagnostic needed jv244 at cam dot ac dot uk
2005-11-27 4:25 ` [Bug fortran/25087] " kargl at gcc dot gnu dot org
2005-11-29 12:00 ` eedelman at gcc dot gnu dot org
2005-11-29 12:06 ` [Bug fortran/25087] Error for missing explicit interface needed eedelman at gcc dot gnu dot org
2006-09-28 11:35 ` fxcoudert at gcc dot gnu dot org
2006-11-15 18:02 ` patchapp at dberlin dot org
2006-11-15 18:59 ` pault at gcc dot gnu dot org
2006-11-22 0:05 ` pault at gcc dot gnu dot org
2006-11-23 19:14 ` pault at gcc dot gnu dot org
2006-11-23 19:17 ` pault at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).