Skip to content

Commit

Permalink
Suppress -Wunused-parameter warning for GCC and clang. (#12355)
Browse files Browse the repository at this point in the history
* Suppress -Wunused-parameter warning for GCC and clang.

Closes #12313

PiperOrigin-RevId: 520066451

* Remove unintended cherrypicked line
  • Loading branch information
deannagarcia committed Mar 28, 2023
1 parent 58ecf38 commit f1c7820
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/google/protobuf/port_def.inc
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,9 @@ static_assert(PROTOBUF_CPLUSPLUS_MIN(201402L), "Protobuf only supports C++14 and
// Turn on -Wdeprecated-enum-enum-conversion. This deprecation comes in C++20
// via http://wg21.link/p1120r0.
#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
// 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"
#endif
#ifdef __GNUC__
#pragma GCC diagnostic push
Expand All @@ -1014,6 +1017,9 @@ static_assert(PROTOBUF_CPLUSPLUS_MIN(201402L), "Protobuf only supports C++14 and
// int index = ...
// int value = vec[index];
#pragma GCC diagnostic ignored "-Wsign-conversion"
// 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"
#endif // __GNUC__

// Silence some MSVC warnings in all our code.
Expand Down

0 comments on commit f1c7820

Please sign in to comment.