Skip to content

Commit

Permalink
Modify port_def.inc to ignore -Wshadow warning (#13059)
Browse files Browse the repository at this point in the history
Closes #13037

Closes #13059

COPYBARA_INTEGRATE_REVIEW=#13059 from 4kangjc:main 71b2fc5
PiperOrigin-RevId: 540886449
  • Loading branch information
4kangjc authored and fowles committed Jun 16, 2023
1 parent 0daa1b1 commit 6241d42
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/google/protobuf/port_def.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,10 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
// This error has been generally flaky, but we need to disable it specifically
// to fix https://github.com/protocolbuffers/protobuf/issues/12313
#pragma clang diagnostic ignored "-Wunused-parameter"
// -Wshadow means that declaration shadows a variable.
// for (int i = 0; i < file_->public_dependency_count(); ++i)
// for (int i = 0; i < public_dep->message_type_count(); ++i)
#pragma clang diagnostic ignored "-Wshadow"
#endif
#ifdef __GNUC__
#pragma GCC diagnostic push
Expand All @@ -1033,6 +1037,10 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
// This error has been generally flaky, but we need to disable it specifically
// to fix https://github.com/protocolbuffers/protobuf/issues/12313
#pragma GCC diagnostic ignored "-Wunused-parameter"
// -Wshadow means that declaration shadows a variable.
// for (int i = 0; i < file_->public_dependency_count(); ++i)
// for (int i = 0; i < public_dep->message_type_count(); ++i)
#pragma GCC diagnostic ignored "-Wshadow"
#ifndef __clang__
// This causes spurious warnings in GCC 13.
#pragma GCC diagnostic ignored "-Wstringop-overflow"
Expand Down

0 comments on commit 6241d42

Please sign in to comment.