Skip to content

Commit 71b2fc5

Browse files
committed
Modify port_def.inc to ignore -Wshadow warning
Closes #13037
1 parent 52430d7 commit 71b2fc5

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/google/protobuf/port_def.inc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,10 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
10351035
// This error has been generally flaky, but we need to disable it specifically
10361036
// to fix https://github.com/protocolbuffers/protobuf/issues/12313
10371037
#pragma clang diagnostic ignored "-Wunused-parameter"
1038+
// -Wshadow means that declaration shadows a variable.
1039+
// for (int i = 0; i < file_->public_dependency_count(); ++i)
1040+
// for (int i = 0; i < public_dep->message_type_count(); ++i)
1041+
#pragma clang diagnostic ignored "-Wshadow"
10381042
#endif
10391043
#ifdef __GNUC__
10401044
#pragma GCC diagnostic push
@@ -1058,6 +1062,10 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
10581062
// This error has been generally flaky, but we need to disable it specifically
10591063
// to fix https://github.com/protocolbuffers/protobuf/issues/12313
10601064
#pragma GCC diagnostic ignored "-Wunused-parameter"
1065+
// -Wshadow means that declaration shadows a variable.
1066+
// for (int i = 0; i < file_->public_dependency_count(); ++i)
1067+
// for (int i = 0; i < public_dep->message_type_count(); ++i)
1068+
#pragma GCC diagnostic ignored "-Wshadow"
10611069
#ifndef __clang__
10621070
// This causes spurious warnings in GCC 13.
10631071
#pragma GCC diagnostic ignored "-Wstringop-overflow"

0 commit comments

Comments
 (0)