aboutsummaryrefslogtreecommitdiff
path: root/gdb/btrace.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-07-26 19:52:47 -0600
committerTom Tromey <tom@tromey.com>2018-10-03 15:19:06 -0600
commitad69edbb4b230582ecd1863e68d0c2044f5ad901 (patch)
treebafe26e96f1575c3f21d221e569545b07c2e7ed2 /gdb/btrace.h
parent780942fc2422d80a49b748e484890f11db31f49e (diff)
downloadgdb-ad69edbb4b230582ecd1863e68d0c2044f5ad901.zip
gdb-ad69edbb4b230582ecd1863e68d0c2044f5ad901.tar.gz
gdb-ad69edbb4b230582ecd1863e68d0c2044f5ad901.tar.bz2
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.
Diffstat (limited to 'gdb/btrace.h')
-rw-r--r--gdb/btrace.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/btrace.h b/gdb/btrace.h
index bfb0b9f2..0448bd6 100644
--- a/gdb/btrace.h
+++ b/gdb/btrace.h
@@ -228,7 +228,7 @@ struct btrace_call_history
};
/* Branch trace thread flags. */
-enum btrace_thread_flag
+enum btrace_thread_flag : unsigned
{
/* The thread is to be stepped forwards. */
BTHR_STEP = (1 << 0),