mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-05-31 10:09:16 +08:00
Use unsigned as base type for some enums
-fsanitize=undefined complains about using operator~ on various enum types that are used with DEF_ENUM_FLAGS_TYPE. This patch fixes these problems by explicitly setting the base type for these enums to unsigned. It also adds a static assert to enum_flags to ensure that future enums used this way have an unsigned underlying type. gdb/ChangeLog 2018-10-03 Tom Tromey <tom@tromey.com> * common/enum-flags.h (enum_flags::operator~): Add static assert. * symfile-add-flags.h (enum symfile_add_flag): Use unsigned as base type. * objfile-flags.h (enum objfile_flag): Use unsigned as base type. * gdbtypes.h (enum type_instance_flag_value): Use unsigned as base type. * c-lang.h (enum c_string_type_values): Use unsigned as base type. * btrace.h (enum btrace_thread_flag): Use unsigned as base type.
This commit is contained in:
@ -26,7 +26,7 @@
|
||||
symbol_file_add, etc. Defined in a separate file to break circular
|
||||
header dependencies. */
|
||||
|
||||
enum symfile_add_flag
|
||||
enum symfile_add_flag : unsigned
|
||||
{
|
||||
/* Be chatty about what you are doing. */
|
||||
SYMFILE_VERBOSE = 1 << 1,
|
||||
|
Reference in New Issue
Block a user