This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/29926] interface overloading assignment does not handle input types correctly
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Nov 2006 18:59:15 -0000
- Subject: [Bug fortran/29926] interface overloading assignment does not handle input types correctly
- References: <bug-29926-11177@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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