public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/52083] New: Misleading warning for internal procedures with names of intrinsic procedures
@ 2012-02-01 16:56 burnus at gcc dot gnu.org
  2015-10-13 17:08 ` [Bug fortran/52083] " dominiq at lps dot ens.fr
  0 siblings, 1 reply; 2+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-02-01 16:56 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug fortran/52083] Misleading warning for internal procedures with names of intrinsic procedures
  2012-02-01 16:56 [Bug fortran/52083] New: Misleading warning for internal procedures with names of intrinsic procedures burnus at gcc dot gnu.org
@ 2015-10-13 17:08 ` dominiq at lps dot ens.fr
  0 siblings, 0 replies; 2+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-10-13 17:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52083

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
      Known to work|                            |4.8.5, 4.9.3, 5.2.0, 6.0
         Resolution|---                         |FIXED

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> 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.

This is exactly the warning I get with 4.8 up to trunk (6.0). With 5.2.0 and
6.0 the message ends with ' [-Wintrinsic-shadow]'.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-13 17:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-01 16:56 [Bug fortran/52083] New: Misleading warning for internal procedures with names of intrinsic procedures burnus at gcc dot gnu.org
2015-10-13 17:08 ` [Bug fortran/52083] " dominiq at lps dot ens.fr

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).