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.
This commit is contained in:
Harald Anlauf 2020-06-07 16:43:12 +02:00
parent 761306fc5e
commit 5aaccde3db

View File

@ -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];