From: Harald Anlauf Date: Sun, 7 Jun 2020 14:43:12 +0000 (+0200) Subject: PR fortran/95091 - Buffer overflows with submodules and long symbols X-Git-Tag: releases/gcc-10.2.0~241 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=605e9b1a9b3250537a7269eba7e9c316b0f00d29;p=thirdparty%2Fgcc.git PR fortran/95091 - Buffer overflows with submodules and long symbols Add cast to fix bootstrap error with -Werror=sign-compare. gcc/fortran/ PR fortran/95091 * class.c (gfc_hash_value): Add cast. (cherry picked from commit 5aaccde3db39fac7e7f6677ceccc1eadd9c6a424) --- diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c index 8bb73502f5d9..2b55859ce753 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];