Fix build for new toolchain 86/295786/2 tizen accepted/tizen/unified/dev/20230726.115946
authorTomasz Swierczek <t.swierczek@samsung.com>
Thu, 13 Jul 2023 12:33:23 +0000 (14:33 +0200)
committerTomasz Swierczek <t.swierczek@samsung.com>
Thu, 13 Jul 2023 12:35:52 +0000 (14:35 +0200)
Change-Id: Ic1bf9f35869ad1be940f02be03835bddbb3c4d6b

CMakeLists.txt
src/osquery/core/query.cpp
src/osquery/core/tables.cpp
src/vist/common/tests/archive.cpp

index 986186457a8d4d6bdc9c3de5a6409f761ac719d7..9fe104d28a15a3fb25e7e6589c0322dbd0c3fedb 100644 (file)
@@ -28,8 +28,8 @@ IF(NOT CMAKE_BUILD_TYPE)
        SET(CMAKE_BUILD_TYPE "DEBUG")
 ENDIF(NOT CMAKE_BUILD_TYPE)
 
-SET(CMAKE_CXX_FLAGS_DEBUG   "-g -std=c++1z -O0 -ggdb -Wp,-U_FORTIFY_SOURCE")
-SET(CMAKE_CXX_FLAGS_RELEASE "-g -std=c++1z -O2 -DNDEBUG")
+SET(CMAKE_CXX_FLAGS_DEBUG   "-g -std=c++1z -O0 -ggdb -Wp,-U_FORTIFY_SOURCE -Wno-overloaded-virtual -Wno-class-memaccess")
+SET(CMAKE_CXX_FLAGS_RELEASE "-g -std=c++1z -O2 -DNDEBUG -Wno-overloaded-virtual -Wno-class-memaccess")
 
 SET(CMAKE_SHARED_LINKER_FLAGS  "-Wl,--as-needed")
 SET(CMAKE_EXE_LINKER_FLAGS     "-Wl,--as-needed")
index 8231e309d536cd436dfbae6e7e963173fbf48837..8a925fe4a4440f0a1c6eea41490188f82d789a7d 100644 (file)
@@ -70,7 +70,6 @@ Status Query::addNewResults(QueryDataTyped current_qd,
 {
        // The current results are 'fresh' when not calculating a differential.
        bool fresh_results = !calculate_diff;
-       bool new_query = false;
        if (!isQueryNameInDatabase()) {
                // This is the first encounter of the scheduled query.
                fresh_results = true;
@@ -82,7 +81,6 @@ Status Query::addNewResults(QueryDataTyped current_qd,
                                          << name_;
        } else if (isNewQuery()) {
                // This query is 'new' in that the previous results may be invalid.
-               new_query = true;
                INFO(OSQUERY) << "Scheduled query has been updated: " + name_;
                saveQuery(name_, query_);
        }
@@ -90,8 +88,6 @@ Status Query::addNewResults(QueryDataTyped current_qd,
        // Use a 'target' avoid copying the query data when serializing and saving.
        // If a differential is requested and needed the target remains the original
        // query data, otherwise the content is moved to the differential's added set.
-       const auto* target_gd = &current_qd;
-       bool update_db = true;
        if (!fresh_results && calculate_diff) {
                // Get the rows from the last run of this query name.
                QueryDataSet previous_qd;
@@ -102,11 +98,8 @@ Status Query::addNewResults(QueryDataTyped current_qd,
 
                // Calculate the differential between previous and current query results.
                dr = diff(previous_qd, current_qd);
-
-               update_db = (!dr.added.empty() || !dr.removed.empty());
        } else {
                dr.added = std::move(current_qd);
-               target_gd = &dr.added;
        }
 
        return Status::success();
index 15ceb56c9e5a9c7bdde4d15c594b61398c36f7e5..95d972c3cb14129cb3c145b364168d0b4582a1d4 100644 (file)
@@ -86,7 +86,7 @@ QueryContext TablePlugin::getContextFromRequest(const PluginRequest& request) co
        if (document.exist("colsUsed")) {
                UsedColumns colsUsed;
                Array array = document.get<Array>("colsUsed");
-               for (auto i = 0; i < array.size(); i++) {
+               for (unsigned i = 0; i < array.size(); i++) {
                        std::string name = array.at(i);
                        colsUsed.insert(name);
                }
@@ -94,7 +94,7 @@ QueryContext TablePlugin::getContextFromRequest(const PluginRequest& request) co
        }
 
        Array constraints = document.get<Array>("constraints");
-       for (auto i = 0; i < constraints.size(); i++) {
+       for (unsigned i = 0; i < constraints.size(); i++) {
                auto constraint = Object::Create(constraints.at(i));
                std::string name = constraint["name"];
                context.constraints[name].deserialize(constraint);
@@ -485,7 +485,7 @@ void ConstraintList::deserialize(vist::json::Object& obj)
 {
        using namespace vist::json;
        Array list = obj.get<Array>("list");
-       for (auto i = 0; i < list.size(); i++) {
+       for (unsigned i = 0; i < list.size(); i++) {
                auto element = vist::json::Object::Create(list.at(i));
                int op = element["op"];
                Constraint constraint(static_cast<unsigned char>(op));
index ab8c69be021569760ea42623eb095a3a0ae1d5eb..8e845053a3e2defbbe42d340ca76025aa689c3a8 100644 (file)
@@ -117,7 +117,7 @@ TEST(ArchiveTests, serializer_fundamental_char)
 
 TEST(ArchiveTests, serializer_fundamental_nullptr)
 {
-       std::nullptr_t input;
+       std::nullptr_t input = nullptr;
 
        Archive archive;
        archive << input;
@@ -287,9 +287,9 @@ TEST(ArchiveTests, parameter_pack_transform)
        Archive archive;
        archive.pack(input1, input2, input3, input4, input5);
 
-       int output1;
-       float output2;
-       double output3;
+       int output1 = 0;
+       float output2 = 1.0;
+       double output3 = 2.0;
        std::string raw;
        std::string& output4 = raw;
        std::shared_ptr<bool> output5;