http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52083
Bug #: 52083 Summary: Misleading warning for internal procedures with names of intrinsic procedures Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: fortran AssignedTo: unassig...@gcc.gnu.org ReportedBy: bur...@gcc.gnu.org The following warning does not make much sense for internal procedures - their interface is known by construction The example prints: Warning: 'fraction' declared at (1) is also the name of an intrinsic. It can only be called via an explicit interface or if declared EXTERNAL. Expected: Do the same as for module procedures, namely print: Warning: 'fraction' declared at (1) may shadow the intrinsic of the same name. In order to call the intrinsic, explicit INTRINSIC declarations may be required. Example: x = fraction() contains function fraction() fraction = 1./42. end function fraction end * * * One probably needs to check: sym->ns->parent && sym->ns->parent->proc_name && sym->ns->parent->proc_name->attr.flavor != FL_MODULE The current checks are done in intrinsic.c's gfc_warn_intrinsic_shadow.