From 5aaccde3db39fac7e7f6677ceccc1eadd9c6a424 Mon Sep 17 00:00:00 2001 From: Harald Anlauf Date: Sun, 7 Jun 2020 16:43:12 +0200 Subject: [PATCH] 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. --- gcc/fortran/class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]; -- 2.30.2