diff mbox

[Fortran] Preparatory patch to change charlen's kind type

Message ID 20161020103735.39f3d520@vepi2
State New
Headers show

Commit Message

Andre Vehreschild Oct. 20, 2016, 8:37 a.m. UTC
Hi all,

during hacking in gfortran I found, that for unlimited polymorphic types the
size type of a char array stored is hard coded to be 4. This small patch
resolves this by using the better suited constant: gfc_charlen_int_kind. This
will make the move to larger strings easier.

Bootstrapped and regtested on x86_64-linux/F23. Ok for trunk?

Regards,
	Andre

Comments

Janne Blomqvist Oct. 20, 2016, 9:57 a.m. UTC | #1
On Thu, Oct 20, 2016 at 11:37 AM, Andre Vehreschild <vehre@gmx.de> wrote:
> Hi all,
>
> during hacking in gfortran I found, that for unlimited polymorphic types the
> size type of a char array stored is hard coded to be 4. This small patch
> resolves this by using the better suited constant: gfc_charlen_int_kind. This
> will make the move to larger strings easier.
>
> Bootstrapped and regtested on x86_64-linux/F23. Ok for trunk?
>
> Regards,
>         Andre
>
> diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c
> index 6d324a6..e110f2c 100644
> --- a/gcc/fortran/class.c
> +++ b/gcc/fortran/class.c
> @@ -707,7 +707,7 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_attribute
> *attr, if (!gfc_add_component (fclass, "_len", &c))
>             return false;
>           c->ts.type = BT_INTEGER;
> -         c->ts.kind = 4;
> +         c->ts.kind = gfc_charlen_int_kind;
>           c->attr.access = ACCESS_PRIVATE;
>           c->attr.artificial = 1;
>         }
>
> --
> Andre Vehreschild * Email: vehre ad gmx dot de

Ok, thanks for catching this!
diff mbox

Patch

diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c
index 6d324a6..e110f2c 100644
--- a/gcc/fortran/class.c
+++ b/gcc/fortran/class.c
@@ -707,7 +707,7 @@  gfc_build_class_symbol (gfc_typespec *ts, symbol_attribute
*attr, if (!gfc_add_component (fclass, "_len", &c))
            return false;
          c->ts.type = BT_INTEGER;
-         c->ts.kind = 4;
+         c->ts.kind = gfc_charlen_int_kind;
          c->attr.access = ACCESS_PRIVATE;
          c->attr.artificial = 1;
        }