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/29926] interface overloading assignment does not handle input types correctly



------- Comment #4 from burnus at gcc dot gnu dot org  2006-11-21 18:59 -------
> I just wanted to point out also that this code does compile and work with
> gfortran 4.2.0 (20060815), an older version I still have installed.

It also compiles with current gfortran 4.3 if you use the option
  -fno-range-check
to force gfortran to ignore the numerical overflow.


But I think the problem is here:
  b = uword(int(65535,kind=4))

The uword() is a structure constructor. It is equivalent to write this as:
  b = uword(value = int(65535,kind=4))
or as
  b%value = int(65535,kind=4)
which converts automatically integer(4) to integer(2) without calling the
uword_assign_4 routine.

You really want to use:
  b = int(65535,kind=4)
without the structure constructor "uword". In this case your uword_assign_4
routine is called, which also gives not overflow and thus no error.


-- 


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


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