diff options
author | Tom de Vries <tdevries@suse.de> | 2020-11-18 19:59:45 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2020-11-18 19:59:45 +0100 |
commit | 5d8254e18560653d6d4d4d62be2a35ef68de4376 (patch) | |
tree | 6e83ddb67d68bc20f8ff65551f689c546e8dad2e | |
parent | e4d9e5422fa233e9e32ce89e07a5a6ca89e85090 (diff) | |
download | binutils-5d8254e18560653d6d4d4d62be2a35ef68de4376.zip binutils-5d8254e18560653d6d4d4d62be2a35ef68de4376.tar.gz binutils-5d8254e18560653d6d4d4d62be2a35ef68de4376.tar.bz2 |
[gdb/build] Fix -Werror=bool-compare warning in update_static_array_size
With current trunk I run into:
...
src/gdb/gdbtypes.c: In function 'bool update_static_array_size(type*)':
src/gdb/gdbtypes.c:1250:64: error: comparison of constant '0' with boolean \
expression is always true [-Werror=bool-compare]
&& get_array_bounds (element_type, &low_bound, &high_bound) >= 0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
...
Fix this by dropping the compare.
gdb/ChangeLog:
2020-11-18 Tom de Vries <tdevries@suse.de>
* gdbtypes.c (update_static_array_size): Fix -Werror=bool-compare
warning.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/gdbtypes.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8c21f97..49b2511 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-11-18 Tom de Vries <tdevries@suse.de> + + * gdbtypes.c (update_static_array_size): Fix -Werror=bool-compare + warning. + 2020-11-17 Simon Marchi <simon.marchi@polymtl.ca> * gdbtypes.h (get_array_bounds): Return bool, adjust some diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index cde0770..b822a36 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) |