Skip to content

Commit

Permalink
Make the underlying type of the enum by 8-bits instead of using bitfi…
Browse files Browse the repository at this point in the history
…elds for

it.
It silences a warning in gcc 8/9.

PiperOrigin-RevId: 633719795
  • Loading branch information
protobuf-github-bot authored and zhangskz committed Jun 7, 2024
1 parent 9a58f07 commit 316f493
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/google/protobuf/descriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -2896,7 +2896,7 @@ typename FieldOpts::CType EffectiveStringCType(const FieldDesc* field) {
}

#ifndef SWIG
enum class Utf8CheckMode {
enum class Utf8CheckMode : uint8_t {
kStrict = 0, // Parsing will fail if non UTF-8 data is in string fields.
kVerify = 1, // Only log an error but parsing will succeed.
kNone = 2, // No UTF-8 check.
Expand Down
2 changes: 1 addition & 1 deletion src/google/protobuf/generated_message_tctable_gen.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ struct PROTOBUF_EXPORT TailCallTableInfo {
uint16_t type_card;

// For internal caching.
cpp::Utf8CheckMode utf8_check_mode : 8;
cpp::Utf8CheckMode utf8_check_mode;
};
std::vector<FieldEntryInfo> field_entries;

Expand Down

0 comments on commit 316f493

Please sign in to comment.