Skip to content

Commit

Permalink
Merge pull request #17077 from protocolbuffers/cp-warn
Browse files Browse the repository at this point in the history
Make the underlying type of the enum by 8-bits instead of using bitfi…
  • Loading branch information
zhangskz authored Jun 11, 2024
2 parents 9a58f07 + aa7fcb3 commit eb61e6b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions protos/protos_extension_lock_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ void TestConcurrentExtensionAccess(::protos::ExtensionRegistry registry) {
test_theme();
test_theme_extension();
}
#ifndef _MSC_VER
// TODO Re-enable this once github runner issue is resolved.

TEST(CppGeneratedCode, ConcurrentAccessDoesNotRaceBothLazy) {
::upb::Arena arena;
Expand All @@ -120,5 +122,7 @@ TEST(CppGeneratedCode, ConcurrentAccessDoesNotRaceBothEager) {
{{&theme, &ThemeExtension::theme_extension}, arena});
}

#endif // _MSC_VER

} // namespace
} // namespace protos_generator::test::protos
3 changes: 3 additions & 0 deletions src/google/protobuf/compiler/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ namespace protobuf {
namespace compiler {

int ProtobufMain(int argc, char* argv[]) {
#ifndef _MSC_VER
// TODO Re-enable this once github runner issue is resolved.
absl::InitializeLog();
#endif // !_MSC_VER

CommandLineInterface cli;
cli.AllowPlugins("protoc-");
Expand Down
3 changes: 3 additions & 0 deletions src/google/protobuf/compiler/main_no_generators.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ namespace compiler {
// This is a version of protoc that has no built-in code generators.
// See go/protobuf-toolchain-protoc
int ProtocMain(int argc, char* argv[]) {
#ifndef _MSC_VER
// TODO Re-enable this once github runner issue is resolved.
absl::InitializeLog();
#endif // !_MSC_VER

CommandLineInterface cli;
cli.AllowPlugins("protoc-");
Expand Down
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 eb61e6b

Please sign in to comment.