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/30239] duplicate data type assignment not detected



------- Comment #1 from burnus at gcc dot gnu dot org  2006-12-17 20:15 -------
This is because in symbol.c's gfc_add_type there is

      const char *msg = "Symbol '%s' at %L already has basic type of %s";
      if (!(sym->ts.type == ts->typesym->ts.type == ts->type
             && (sym->attr.flavor == FL_PROCEDURE || sym->attr.result))
           || gfc_notification_std (GFC_STD_GNU) == ERROR
           || pedantic)
        {
          gfc_error (msg, sym->name, where, gfc_basic_typename (sym->ts.type));
          return FAILURE;
        }

The !(sym->ts.type == ts->type) prevents the error message. Removing this check
should all what is needed for this bug.
But this might break other cases were it is allowed. (I didn't check/though
about those, however).


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-12-17 20:15:55
               date|                            |


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


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