diff --git a/.clang-tidy b/.clang-tidy index b0332b71229a3..98cfdf21cea70 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -123,7 +123,7 @@ clang-analyzer-optin.portability.UnixAPI, -clang-analyzer-osx.coreFoundation.CFRetainRelease, -clang-analyzer-osx.coreFoundation.containers.OutOfBounds, -clang-analyzer-osx.coreFoundation.containers.PointerSizedValues, --clang-analyzer-security.FloatLoopCounter, +clang-analyzer-security.FloatLoopCounter, -clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling, -clang-analyzer-security.insecureAPI.SecuritySyntaxChecker, -clang-analyzer-security.insecureAPI.UncheckedReturn, diff --git a/paddle/fluid/inference/utils/table_printer.cc b/paddle/fluid/inference/utils/table_printer.cc index a29598f9bcc3b..ba7a8d342e352 100644 --- a/paddle/fluid/inference/utils/table_printer.cc +++ b/paddle/fluid/inference/utils/table_printer.cc @@ -186,7 +186,7 @@ void TablePrinter::CalcLayout() { void TablePrinter::AddRowDivider(std::stringstream& ss) { ss << "+"; for (float share : shares_) { - for (float j = 0; j < share + 2; ++j) ss << "-"; + for (int j = 0; j < static_cast(share) + 2; ++j) ss << "-"; ss << "+"; } ss << "\n"; diff --git a/paddle/fluid/platform/profiler/event_node.cc b/paddle/fluid/platform/profiler/event_node.cc index 1657810fbe666..c92ae133814f3 100644 --- a/paddle/fluid/platform/profiler/event_node.cc +++ b/paddle/fluid/platform/profiler/event_node.cc @@ -340,7 +340,7 @@ HostTraceEventNode* NodeTrees::BuildTreeRelationship( // build relationship between host event node and op supplement node for (auto it = post_order_nodes.begin(); it < post_order_nodes.end(); ++it) { - int op_supplement_count = 0; + int op_supplement_count = 0; // NOLINT bool hasenter = false; std::vector::iterator firstposition; std::vector::iterator lastposition = diff --git a/test/cpp/fluid/reader/reader_blocking_queue_test.cc b/test/cpp/fluid/reader/reader_blocking_queue_test.cc index b02f21eb2eb49..b05a932f72891 100644 --- a/test/cpp/fluid/reader/reader_blocking_queue_test.cc +++ b/test/cpp/fluid/reader/reader_blocking_queue_test.cc @@ -203,7 +203,7 @@ struct MyClass { MyClass() : val_(0) {} explicit MyClass(int val) : val_(val) {} MyClass(const MyClass& b) { val_ = b.val_; } - MyClass(MyClass&& b) { val_ = b.val_; } + MyClass(MyClass&& b) noexcept { val_ = b.val_; } MyClass& operator=(const MyClass& b) { if (this != &b) { val_ = b.val_;