This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/52083] New: Misleading warning for internal procedures with names of intrinsic procedures
- 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: Wed, 01 Feb 2012 16:56:21 +0000
- Subject: [Bug fortran/52083] New: Misleading warning for internal procedures with names of intrinsic procedures
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: burnus@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.