This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/45823] Bogus warning for intrinsic module procedures


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45823

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-05-12 10:35:23 UTC ---
(In reply to comment #1)
> This bug basically makes the option -Wsurprising useless in combination with
> iso_fortran_env.
Well, you can still use ONLY - which is a decent work around, unless you really
need the two functions.


Regarding the test case from comment 0: resolve_intrinsic is called twice -
once from resolve_symbol (which sets then ts.type) and then again for
resolve_function; the second call to resolve_intrinsic generates then the
warning.

The following patch should work. It prevents the warning but if one tries to
modify the type, one gets the normal module warning:

Error: Symbol 'compiler_options' at (1) already has basic type of CHARACTER


--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -1454,7 +1454,7 @@ resolve_intrinsic (gfc_symbol *sym, locus *loc)
   if (isym)
     {
       if (sym->ts.type != BT_UNKNOWN && gfc_option.warn_surprising
-         && !sym->attr.implicit_type)
+         && !sym->attr.implicit_type && !sym->from_intmod)
        gfc_warning ("Type specified for intrinsic function '%s' at %L is"
                      " ignored", sym->name, &sym->declared_at);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]