Suppress -Wunused-parameter warning for GCC and clang. (#12355)

* Suppress -Wunused-parameter warning for GCC and clang.

Closes https://github.com/protocolbuffers/protobuf/issues/12313

PiperOrigin-RevId: 520066451

* Remove unintended cherrypicked line
pull/12419/head
deannagarcia 2 years ago committed by GitHub
parent 58ecf38aa5
commit f1c7820c9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/google/protobuf/port_def.inc

@ -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 // Turn on -Wdeprecated-enum-enum-conversion. This deprecation comes in C++20
// via http://wg21.link/p1120r0. // via http://wg21.link/p1120r0.
#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion" #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 #endif
#ifdef __GNUC__ #ifdef __GNUC__
#pragma GCC diagnostic push #pragma GCC diagnostic push
@ -1014,6 +1017,9 @@ static_assert(PROTOBUF_CPLUSPLUS_MIN(201402L), "Protobuf only supports C++14 and
// int index = ... // int index = ...
// int value = vec[index]; // int value = vec[index];
#pragma GCC diagnostic ignored "-Wsign-conversion" #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__ #endif // __GNUC__
// Silence some MSVC warnings in all our code. // Silence some MSVC warnings in all our code.

Loading…
Cancel
Save