This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47042] ICE with character pointer in function
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 29 Jan 2011 16:40:01 +0000
- Subject: [Bug fortran/47042] ICE with character pointer in function
- Auto-submitted: auto-generated
- References: <bug-47042-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47042
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-invalid-code
CC| |burnus at gcc dot gnu.org
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-01-29 16:39:57 UTC ---
NAG shows the error:
POINTER function PTMP needs an explicit interface
Intel the error:
This name has not been declared as an array or a function. [PTMP]
get_cstring(i:i) = ptmp(i)
-----------------------^
g95:
Error: POINTER function 'ptmp' at (1) must have an explicit interface
"A procedure other than a statement function shall have an explicit interface
if it is referenced and [...]
(3) the procedure has a result that
(a) is an array,
(b) is a pointer or is allocatable, or [...]"
(F2008, "12.4.2.2 Explicit interface")
One could add such a check in gfc_procedure_use:
if (sym->attr.if_source == IFSRC_UNKNOWN)
{
[...]
if (sym->attr.pointer && sym->attr.proc != PROC_ST_FUNCTION)
{
gfc_error ("");
Possibly also needed for ALLOCATABLE and maybe even with Dimension?