diff --git a/src/google/protobuf/stubs/common.cc b/src/google/protobuf/stubs/common.cc index 381533218d..ec253ed9b6 100644 --- a/src/google/protobuf/stubs/common.cc +++ b/src/google/protobuf/stubs/common.cc @@ -354,7 +354,8 @@ struct ShutdownData { }; static void RunZeroArgFunc(const void* arg) { - reinterpret_cast(const_cast(arg))(); + void (*func)() = reinterpret_cast(const_cast(arg)); + func(); } void OnShutdown(void (*func)()) {