Yes, it works. On Sun, Jun 7, 2020 at 7:19 AM Harald Anlauf <anl...@gmx.de> wrote: > > Hi H.J., > > > Gesendet: Sonntag, 07. Juni 2020 um 16:02 Uhr > > Von: "H.J. Lu" <hjl.to...@gmail.com> > > An: "Thomas Koenig" <tkoe...@netcologne.de> > > Cc: "Harald Anlauf" <anl...@gmx.de>, "fortran" <fort...@gcc.gnu.org>, > > "gcc-patches" <gcc-patches@gcc.gnu.org> > > Betreff: Re: [PATCH] PR fortran/95091 - Buffer overflows with submodules > > and long symbols > > > This may have broken bootstrap: > > > > https://gcc.gnu.org/pipermail/gcc-regression/2020-June/072701.html > [...] > > In file included from ../../src-master/gcc/fortran/class.c:58: > > ../../src-master/gcc/fortran/class.c: In function ‘unsigned int > > gfc_hash_value(gfc_symbol*)’: > > ../../src-master/gcc/fortran/class.c:543:19: error: comparison of > > integer expressions of different signedness: ‘int’ and ‘long unsigned > > int’ [-Werror=sign-compare] > > 543 | gcc_assert (len < sizeof (c)); > > | ~~~~^~~~~~~~~~~~ > > Does the following patch fix bootstrap for you? > > diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c > index 8bb73502f5d..2b55859ce75 100644 > --- a/gcc/fortran/class.c > +++ b/gcc/fortran/class.c > @@ -540,7 +540,7 @@ gfc_hash_value (gfc_symbol *sym) > > get_unique_type_string (&c[0], sym); > len = strnlen (c, sizeof (c)); > - gcc_assert (len < sizeof (c)); > + gcc_assert ((size_t) len < sizeof (c)); > > for (i = 0; i < len; i++) > hash = (hash << 6) + (hash << 16) - hash + c[i]; > > Harald >
-- H.J.