diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8c21f973137..49b2511cae2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-11-18 Tom de Vries + + * gdbtypes.c (update_static_array_size): Fix -Werror=bool-compare + warning. + 2020-11-17 Simon Marchi * gdbtypes.h (get_array_bounds): Return bool, adjust some diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index cde07702734..b822a369a16 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -1247,7 +1247,7 @@ update_static_array_size (struct type *type) if (element_type->code () == TYPE_CODE_ARRAY && TYPE_LENGTH (element_type) != 0 && TYPE_FIELD_BITSIZE (element_type, 0) != 0 - && get_array_bounds (element_type, &low_bound, &high_bound) >= 0 + && get_array_bounds (element_type, &low_bound, &high_bound) && high_bound >= low_bound) TYPE_FIELD_BITSIZE (type, 0) = ((high_bound - low_bound + 1)