From e95838dd020c2a9d7cd3bd67567941049945e8a0 Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Mon, 25 Apr 2022 23:33:01 +0800 Subject: [PATCH] fix gcc warning of cast-function-type (#42235) --- cmake/flags.cmake | 1 - paddle/fluid/pybind/fleet_py.cc | 6 +----- paddle/fluid/pybind/inference_api.cc | 5 +---- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/cmake/flags.cmake b/cmake/flags.cmake index 5742a6b602f..c1a7ba6d909 100644 --- a/cmake/flags.cmake +++ b/cmake/flags.cmake @@ -163,7 +163,6 @@ if(NOT APPLE) set(COMMON_FLAGS ${COMMON_FLAGS} -Wno-format-truncation # Warning in boost gcc 8.2 - -Wno-error=cast-function-type # Warning in boost gcc 8.2 -Wno-error=parentheses # Warning in boost gcc 8.2 -Wno-error=catch-value # Warning in boost gcc 8.2 -Wno-error=nonnull-compare # Warning in boost gcc 8.2 diff --git a/paddle/fluid/pybind/fleet_py.cc b/paddle/fluid/pybind/fleet_py.cc index 4a1dadd6d25..00ceaf252dc 100644 --- a/paddle/fluid/pybind/fleet_py.cc +++ b/paddle/fluid/pybind/fleet_py.cc @@ -60,11 +60,7 @@ void BindDistFleetWrapper(py::module* m) { .def("load_model", &FleetWrapper::LoadModel) .def("load_one_table", &FleetWrapper::LoadModelOneTable) .def("init_server", &FleetWrapper::InitServer) - .def("run_server", - (uint64_t (FleetWrapper::*)(void)) & FleetWrapper::RunServer) - .def("run_server", (uint64_t (FleetWrapper::*)( // NOLINT - const std::string&, uint32_t)) & // NOLINT - FleetWrapper::RunServer) + .def("run_server", &FleetWrapper::RunServer) .def("init_worker", &FleetWrapper::InitWorker) .def("push_dense_params", &FleetWrapper::PushDenseParamSync) .def("pull_dense_params", &FleetWrapper::PullDenseVarsSync) diff --git a/paddle/fluid/pybind/inference_api.cc b/paddle/fluid/pybind/inference_api.cc index 91d5d396227..1bbe6808b28 100644 --- a/paddle/fluid/pybind/inference_api.cc +++ b/paddle/fluid/pybind/inference_api.cc @@ -765,10 +765,7 @@ void BindMkldnnQuantizerConfig(py::module *m) { return; }) .def("set_quant_batch_size", &MkldnnQuantizerConfig::SetWarmupBatchSize) - .def( - "set_enabled_op_types", - (void (MkldnnQuantizerConfig::*)(std::unordered_set &)) & - MkldnnQuantizerConfig::SetEnabledOpTypes); + .def("set_enabled_op_types", &MkldnnQuantizerConfig::SetEnabledOpTypes); } #endif -- GitLab