Fix silly gcc warning.
Explicitly specify the underlying type of LinkerPatch::Type
as uint8_t because gcc would select a bigger type and then
complain that
'art::LinkerPatch::patch_type_' is too small to hold all
values of 'enum class art::LinkerPatch::Type'
which is really ridiculous given that the enum contains only
a handful enumerators with default (small) values.
Change-Id: I4c4b21cde62e56b62488bae99d3690d900c3c29e
diff --git a/compiler/compiled_method.h b/compiler/compiled_method.h
index b5c99e8..70161eb 100644
--- a/compiler/compiled_method.h
+++ b/compiler/compiled_method.h
@@ -161,7 +161,14 @@
class LinkerPatch {
public:
- enum class Type {
+ // Note: We explicitly specify the underlying type of the enum because GCC
+ // would otherwise select a bigger underlying type and then complain that
+ // 'art::LinkerPatch::patch_type_' is too small to hold all
+ // values of 'enum class art::LinkerPatch::Type'
+ // which is ridiculous given we have only a handful of values here. If we
+ // choose to squeeze the Type into fewer than 8 bits, we'll have to declare
+ // patch_type_ as an uintN_t and do explicit static_cast<>s.
+ enum class Type : uint8_t {
kRecordPosition, // Just record patch position for patchoat.
kMethod,
kCall,