diff --git a/common_settings.bzl b/common_settings.bzl index e05690a908..c4e3465151 100644 --- a/common_settings.bzl +++ b/common_settings.bzl @@ -122,7 +122,15 @@ COMMON_STATIC_LIBS_COPTS = select({ "-Werror", ], "//src:windows" : [ - "-Wall", + "/W4 /WX", + "/analyze", + "/sdl", + "/guard:cf", + "/analyze", + "/Gy", + "/DYNAMICBASE", + #"/NXCOMPAT", + "/GS", ], }) @@ -165,6 +173,8 @@ COMMON_STATIC_LIBS_LINKOPTS = select({ ], "//src:windows" : [ "", + "/LTCG", + "/CETCOMPAT", ], }) COPTS_PYTHON = select({ diff --git a/src/dags/nodesessionmetadata.cpp b/src/dags/nodesessionmetadata.cpp index 34ee487af5..371a654201 100644 --- a/src/dags/nodesessionmetadata.cpp +++ b/src/dags/nodesessionmetadata.cpp @@ -83,7 +83,7 @@ std::string NodeSessionMetadata::createSessionKey(const std::set& i } std::stringstream ss; size_t j = 0; - for (int32_t i = sessionsLevels.size() - 1; i >= 0; --i, ++j) { + for (size_t i = sessionsLevels.size() - 1; i >= 0; --i, ++j) { if ((ignoredNodeNames.size() > 0) && (ignoredNodeNames.size() > j) && (sessionsLevels.size() >= ignoredNodeNames.size()) && diff --git a/src/embeddings/embeddings_api.cpp b/src/embeddings/embeddings_api.cpp index 8c2ff60139..a6e2b7ba9c 100644 --- a/src/embeddings/embeddings_api.cpp +++ b/src/embeddings/embeddings_api.cpp @@ -138,7 +138,7 @@ EmbeddingsRequest::EncodingFormat EmbeddingsHandler::getEncodingFormat() const { void EmbeddingsHandler::setPromptTokensUsage(int promptTokens) { this->promptTokens = promptTokens; } - +#pragma warning( disable : 4244 ) absl::Status EmbeddingsHandler::parseResponse(StringBuffer& buffer, const ov::Tensor& embeddingsTensor, const bool normalizeEmbeddings) { Writer writer(buffer); writer.StartObject(); diff --git a/src/kfs_frontend/kfs_graph_executor_impl.cpp b/src/kfs_frontend/kfs_graph_executor_impl.cpp index 2bf0072d53..c42dc665d8 100644 --- a/src/kfs_frontend/kfs_graph_executor_impl.cpp +++ b/src/kfs_frontend/kfs_graph_executor_impl.cpp @@ -43,9 +43,12 @@ #include "opencv2/opencv.hpp" #if (PYTHON_DISABLE == 0) +#pragma warning(push) +#pragma warning(disable: 6326 28182 6011 28020) #include #include #include +#pragma warning(pop) #include "../python/python_backend.hpp" #include "../python/pythonnoderesources.hpp" diff --git a/src/llm/llmnoderesources.hpp b/src/llm/llmnoderesources.hpp index debe5942e1..b0cd7de765 100644 --- a/src/llm/llmnoderesources.hpp +++ b/src/llm/llmnoderesources.hpp @@ -30,9 +30,11 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #include "mediapipe/framework/calculator_graph.h" #pragma GCC diagnostic pop - +#pragma warning(push) +#pragma warning(disable: 6326 28182 6011 28020) #include // everything needed for embedding #include +#pragma warning(pop) #include "../logging.hpp" #include "../stringutils.hpp" diff --git a/src/llm/text_processor.cpp b/src/llm/text_processor.cpp index a7681b010b..1fb7c01042 100644 --- a/src/llm/text_processor.cpp +++ b/src/llm/text_processor.cpp @@ -23,9 +23,12 @@ #include "mediapipe/framework/calculator_framework.h" #pragma GCC diagnostic pop +#pragma warning(push) +#pragma warning(disable: 6326 28182 6011 28020) // Python execution for template processing #include // everything needed for embedding #include +#pragma warning(pop) namespace ovms { diff --git a/src/llm/text_processor.hpp b/src/llm/text_processor.hpp index fdd26703c5..894b6af7b7 100644 --- a/src/llm/text_processor.hpp +++ b/src/llm/text_processor.hpp @@ -21,9 +21,12 @@ #include #include +#pragma warning(push) +#pragma warning(disable: 6326 28182 6011 28020) // Python execution for template processing #include // everything needed for embedding #include +#pragma warning(pop) #include "src/python/utils.hpp" diff --git a/src/python/binding/ovms_py_tensor.cpp b/src/python/binding/ovms_py_tensor.cpp index 909f97d72f..93c3551666 100644 --- a/src/python/binding/ovms_py_tensor.cpp +++ b/src/python/binding/ovms_py_tensor.cpp @@ -17,9 +17,11 @@ #include "src/python/ovms_py_tensor.hpp" #include - +#pragma warning(push) +#pragma warning(disable: 6326 28182 6011 28020) #include #include +#pragma warning(pop) namespace py = pybind11; using namespace ovms; diff --git a/src/python/ovms_py_tensor.cpp b/src/python/ovms_py_tensor.cpp index 8cfd72d949..fd64b5e8a3 100644 --- a/src/python/ovms_py_tensor.cpp +++ b/src/python/ovms_py_tensor.cpp @@ -22,11 +22,15 @@ #include #include +#pragma warning(push) +#pragma warning(disable: 6326 28182 6011 28020) #include +#pragma warning(pop) namespace py = pybind11; using namespace ovms; +#pragma warning( disable : 4244 ) OvmsPyTensor::OvmsPyTensor(const std::string& name, const py::buffer& buffer, const std::optional>& shape, const std::optional& datatype) : name(name), refObj(buffer) { diff --git a/src/python/ovms_py_tensor.hpp b/src/python/ovms_py_tensor.hpp index 51e3fd5f26..63be141105 100644 --- a/src/python/ovms_py_tensor.hpp +++ b/src/python/ovms_py_tensor.hpp @@ -22,7 +22,10 @@ #include #include +#pragma warning(push) +#pragma warning(disable: 6326 28182 6011 28020) #include +#pragma warning(pop) namespace py = pybind11; diff --git a/src/python/pytensor_ovtensor_converter_calculator.cc b/src/python/pytensor_ovtensor_converter_calculator.cc index 9623aa31c8..8360d777a5 100644 --- a/src/python/pytensor_ovtensor_converter_calculator.cc +++ b/src/python/pytensor_ovtensor_converter_calculator.cc @@ -22,8 +22,11 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #include "mediapipe/framework/calculator_framework.h" #pragma GCC diagnostic pop +#pragma warning(push) +#pragma warning(disable: 6326 28182 6011 28020) #include // everything needed for embedding #include +#pragma warning(pop) #include "../precision.hpp" #include "python_backend.hpp" diff --git a/src/python/python_backend.cpp b/src/python/python_backend.cpp index c1238d405c..499086488e 100644 --- a/src/python/python_backend.cpp +++ b/src/python/python_backend.cpp @@ -16,14 +16,17 @@ #include "python_backend.hpp" +#pragma warning(push) +#pragma warning(disable: 6326 28182 6011 28020) #include +#pragma warning(pop) #include "../logging.hpp" namespace py = pybind11; using namespace py::literals; using namespace ovms; - +#pragma warning( disable : 4101 ) bool PythonBackend::createPythonBackend(PythonBackend** pythonBackend) { py::gil_scoped_acquire acquire; try { diff --git a/src/python/python_backend.hpp b/src/python/python_backend.hpp index ccbda376e8..2c5363bac1 100644 --- a/src/python/python_backend.hpp +++ b/src/python/python_backend.hpp @@ -18,10 +18,12 @@ #include #include #include - +#pragma warning(push) +#pragma warning(disable: 6326 28182 6011 28020) #include #include #include +#pragma warning(pop) #include "utils.hpp" diff --git a/src/python/python_executor_calculator.cc b/src/python/python_executor_calculator.cc index 61e3f7be59..1ecf198d98 100644 --- a/src/python/python_executor_calculator.cc +++ b/src/python/python_executor_calculator.cc @@ -22,9 +22,11 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #include "mediapipe/framework/calculator_framework.h" #pragma GCC diagnostic pop - +#pragma warning(push) +#pragma warning(disable: 6326 28182 6011 28020) #include // everything needed for embedding #include +#pragma warning(pop) #include "python_backend.hpp" diff --git a/src/python/pythoninterpretermodule.cpp b/src/python/pythoninterpretermodule.cpp index 3dfe333947..0447a7765b 100644 --- a/src/python/pythoninterpretermodule.cpp +++ b/src/python/pythoninterpretermodule.cpp @@ -17,8 +17,10 @@ #include #include - +#pragma warning(push) +#pragma warning(disable: 6326 28182 6011 28020) #include // everything needed for embedding +#pragma warning(pop) #include "../config.hpp" #include "../logging.hpp" @@ -30,7 +32,7 @@ namespace py = pybind11; namespace ovms { -Status PythonInterpreterModule::start(const ovms::Config& config) { +Status PythonInterpreterModule::start(const ovms::Config&) { state = ModuleState::STARTED_INITIALIZE; SPDLOG_INFO("{} starting", PYTHON_INTERPRETER_MODULE_NAME); this->threadId = std::this_thread::get_id(); diff --git a/src/python/pythonnoderesources.cpp b/src/python/pythonnoderesources.cpp index afdcbc1cd0..466d4ca68d 100644 --- a/src/python/pythonnoderesources.cpp +++ b/src/python/pythonnoderesources.cpp @@ -29,7 +29,10 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #include "mediapipe/framework/calculator_graph.h" #pragma GCC diagnostic pop +#pragma warning(push) +#pragma warning(disable: 6326 28182 6011 28020) #include // everything needed for embedding +#pragma warning(pop) #include "../mediapipe_internal/mediapipe_utils.hpp" #include "src/python/python_executor_calculator.pb.h" diff --git a/src/python/pythonnoderesources.hpp b/src/python/pythonnoderesources.hpp index cc43295082..839fab83a5 100644 --- a/src/python/pythonnoderesources.hpp +++ b/src/python/pythonnoderesources.hpp @@ -18,8 +18,10 @@ #include #include #include - +#pragma warning(push) +#pragma warning(disable: 6326 28182 6011 28020) #include // everything needed for embedding +#pragma warning(pop) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" diff --git a/src/python/utils.hpp b/src/python/utils.hpp index 33824fb24f..1faafdcb5b 100644 --- a/src/python/utils.hpp +++ b/src/python/utils.hpp @@ -18,10 +18,12 @@ #include #include - +#pragma warning(push) +#pragma warning(disable: 6326 28182 6011 28020) #include #include #include +#pragma warning(pop) #include "../logging.hpp" namespace py = pybind11; diff --git a/src/test/llmnode_test.cpp b/src/test/llmnode_test.cpp index f705b38e68..7649da98b0 100644 --- a/src/test/llmnode_test.cpp +++ b/src/test/llmnode_test.cpp @@ -26,7 +26,10 @@ #include #include #include +#pragma warning(push) +#pragma warning(disable: 6326 28182 6011 28020) #include +#pragma warning(pop) #include "../http_rest_api_handler.hpp" #include "../http_status_code.hpp" diff --git a/src/test/llmtemplate_test.cpp b/src/test/llmtemplate_test.cpp index f134155ffd..de9d23bac3 100644 --- a/src/test/llmtemplate_test.cpp +++ b/src/test/llmtemplate_test.cpp @@ -21,7 +21,10 @@ #include #include #include +#pragma warning(push) +#pragma warning(disable: 6326 28182 6011 28020) #include +#pragma warning(pop) #include #include "../filesystem.hpp" diff --git a/src/test/mediapipeflow_test.cpp b/src/test/mediapipeflow_test.cpp index 29791d7236..83b1ae65b2 100644 --- a/src/test/mediapipeflow_test.cpp +++ b/src/test/mediapipeflow_test.cpp @@ -61,7 +61,10 @@ #include "test_utils.hpp" #if (PYTHON_DISABLE == 0) +#pragma warning(push) +#pragma warning(disable: 6326 28182 6011 28020) #include +#pragma warning(pop) #include "../python/pythonnoderesources.hpp" namespace py = pybind11; diff --git a/src/test/python/ovms_py_tensor_test.cpp b/src/test/python/ovms_py_tensor_test.cpp index 26647f4262..38621968a5 100644 --- a/src/test/python/ovms_py_tensor_test.cpp +++ b/src/test/python/ovms_py_tensor_test.cpp @@ -17,7 +17,10 @@ #include #include +#pragma warning(push) +#pragma warning(disable: 6326 28182 6011 28020) #include +#pragma warning(pop) #include "bindings/python/ovms_py_tensor.hpp" diff --git a/src/test/pythonnode_test.cpp b/src/test/pythonnode_test.cpp index f115d255af..70fe49c35f 100644 --- a/src/test/pythonnode_test.cpp +++ b/src/test/pythonnode_test.cpp @@ -23,7 +23,10 @@ #include #include #include +#pragma warning(push) +#pragma warning(disable: 6326 28182 6011 28020) #include +#pragma warning(pop) #include "../config.hpp" #include "../dags/pipelinedefinition.hpp" diff --git a/src/test/streaming_test.cpp b/src/test/streaming_test.cpp index cc2f088f7b..bbb53429a5 100644 --- a/src/test/streaming_test.cpp +++ b/src/test/streaming_test.cpp @@ -547,7 +547,10 @@ node { // PYTHON CALCULATOR CASES #if (PYTHON_DISABLE == 0) +#pragma warning(push) +#pragma warning(disable: 6326 28182 6011 28020) #include // everything needed for embedding +#pragma warning(pop) namespace py = pybind11; #include "../python/python_backend.hpp" // ------------------------- Regular mode