procedure declaration
Janus Weil
jaydub66@googlemail.com
Sat Jun 23 17:22:00 GMT 2007
Hi all,
I modified Paul's patch on the PROCEDURE machinery to include some of
Christopher's work and to handle formal argument lists right (patch is
attached). I hope this works now, at least I get no more ICE's.
But when trying to compile the attached simple test program, I now get
the following error:
simple.f90:17.18:
integer function a (x)
1
simple.f90:11.19:
procedure(w) :: a
2
Error: Procedure 'a' at (1) has an explicit interface and must not
have attributes declared at (2)
This error comes from decl.c(get_proc_name):
/* Trap declarations of attributes in encompassing scope. The
signature for this is that ts.kind is set. Legitimate
references only set ts.type. */
if (sym->ts.kind != 0
&& !sym->attr.implicit_type
&& sym->attr.proc == 0
&& gfc_current_ns->parent != NULL
&& sym->attr.access == 0
&& !module_fcn_entry)
gfc_error_now ("Procedure '%s' at %C has an explicit interface "
"and must not have attributes declared at %L",
name, &sym->declared_at);
}
What am I doing wrong? Or what would be the best way to get rid of this error?
Should I include (sym->attr.procedure==0) in the above if statement?
Or should I rather modify sym->attr.proc in gfc_match_procedure?
(Maybe sym->attr.proc=PROC_INTERNAL in this case?)
Any other suggestions?
Cheers,
Janus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simple.f90
Type: text/x-fortran
Size: 256 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070623/992d1d6d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: procpatch125971.diff
Type: text/x-patch
Size: 20476 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070623/992d1d6d/attachment-0001.bin>
More information about the Fortran
mailing list