diff --git a/modules/core/test/test_mat.cpp b/modules/core/test/test_mat.cpp index 9d15b6321a..4b6dcb8fcf 100644 --- a/modules/core/test/test_mat.cpp +++ b/modules/core/test/test_mat.cpp @@ -601,7 +601,7 @@ static void setValue(SparseMat& M, const int* idx, double value, RNG& rng) CV_Error(CV_StsUnsupportedFormat, ""); } -#if defined(__GNUC__) && (__GNUC__ == 11 || __GNUC__ == 12) +#if defined(__GNUC__) && (__GNUC__ == 11 || __GNUC__ == 12 || __GNUC__ == 13) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Warray-bounds" #endif diff --git a/modules/dnn/src/layers/layers_common.cpp b/modules/dnn/src/layers/layers_common.cpp index b128872817..48401893f0 100644 --- a/modules/dnn/src/layers/layers_common.cpp +++ b/modules/dnn/src/layers/layers_common.cpp @@ -149,10 +149,11 @@ void getPoolingKernelParams(const LayerParams ¶ms, std::vector& kern std::vector& strides, cv::String &padMode) { bool is_global = params.get("global_pooling", false); - globalPooling.resize(3); - globalPooling[0] = params.get("global_pooling_d", is_global); - globalPooling[1] = params.get("global_pooling_h", is_global); - globalPooling[2] = params.get("global_pooling_w", is_global); + globalPooling.assign({ + params.get("global_pooling_d", is_global), + params.get("global_pooling_h", is_global), + params.get("global_pooling_w", is_global) + }); if (globalPooling[0] || globalPooling[1] || globalPooling[2]) { diff --git a/modules/dnn/src/tensorflow/tf_importer.cpp b/modules/dnn/src/tensorflow/tf_importer.cpp index 28744c586a..9ebd2a6b1d 100644 --- a/modules/dnn/src/tensorflow/tf_importer.cpp +++ b/modules/dnn/src/tensorflow/tf_importer.cpp @@ -260,6 +260,11 @@ const tensorflow::AttrValue& getLayerAttr(const tensorflow::NodeDef &layer, cons return layer.attr().at(name); } +#if defined(__GNUC__) && (__GNUC__ == 13) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdangling-reference" +#endif + static DataLayout getDataLayout(const tensorflow::NodeDef& layer) { if (hasLayerAttr(layer, "data_format")) @@ -2978,6 +2983,10 @@ static void addConstNodes(tensorflow::GraphDef& net, std::map& cons CV_LOG_DEBUG(NULL, "DNN/TF: layers_to_ignore.size() = " << layers_to_ignore.size()); } +#if defined(__GNUC__) && (__GNUC__ == 13) +#pragma GCC diagnostic pop +#endif + // If all inputs of specific layer have the same data layout we can say that // this layer's output has this data layout too. Returns DNN_LAYOUT_UNKNOWN otherwise. DataLayout TFImporter::predictOutputDataLayout(const tensorflow::NodeDef& layer) diff --git a/modules/gapi/src/compiler/passes/exec.cpp b/modules/gapi/src/compiler/passes/exec.cpp index 93d833d602..24dcef7bc1 100644 --- a/modules/gapi/src/compiler/passes/exec.cpp +++ b/modules/gapi/src/compiler/passes/exec.cpp @@ -142,6 +142,11 @@ namespace std::unordered_set cycle_causers; }; +#if defined(__GNUC__) && (__GNUC__ == 13) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdangling-reference" +#endif + bool canMerge(const GIslandModel::Graph &g, const ade::NodeHandle &a_nh, const ade::NodeHandle &slot_nh, @@ -191,6 +196,10 @@ namespace return true; } +#if defined(__GNUC__) && (__GNUC__ == 13) +#pragma GCC diagnostic pop +#endif + inline bool isProducedBy(const ade::NodeHandle &slot, const ade::NodeHandle &island) { diff --git a/modules/gapi/src/streaming/onevpl/file_data_provider.hpp b/modules/gapi/src/streaming/onevpl/file_data_provider.hpp index 10171999a0..7e5e49b0e8 100644 --- a/modules/gapi/src/streaming/onevpl/file_data_provider.hpp +++ b/modules/gapi/src/streaming/onevpl/file_data_provider.hpp @@ -18,6 +18,14 @@ namespace cv { namespace gapi { namespace wip { namespace onevpl { + +// With gcc13, std::unique_ptr(FILE, decltype(&fclose)> causes ignored-attributes warning. +// See https://stackoverflow.com/questions/76849365/can-we-add-attributes-to-standard-function-declarations-without-breaking-standar +#if defined(__GNUC__) && (__GNUC__ == 13) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wignored-attributes" +#endif + struct GAPI_EXPORTS FileDataProvider : public IDataProvider { using file_ptr = std::unique_ptr; @@ -34,6 +42,11 @@ private: mfx_codec_id_type codec; const uint32_t bitstream_data_size; }; + +#if defined(__GNUC__) && (__GNUC__ == 13) +#pragma GCC diagnostic pop +#endif + } // namespace onevpl } // namespace wip } // namespace gapi diff --git a/modules/stitching/src/camera.cpp b/modules/stitching/src/camera.cpp index 149ba74760..2f7ee97e06 100644 --- a/modules/stitching/src/camera.cpp +++ b/modules/stitching/src/camera.cpp @@ -66,7 +66,7 @@ Mat CameraParams::K() const Mat_ k = Mat::eye(3, 3, CV_64F); k(0,0) = focal; k(0,2) = ppx; k(1,1) = focal * aspect; k(1,2) = ppy; - return std::move(k); + return Mat(k); } } // namespace detail diff --git a/modules/video/src/optical_flow_io.cpp b/modules/video/src/optical_flow_io.cpp index 8f9efedc33..ff34f25097 100644 --- a/modules/video/src/optical_flow_io.cpp +++ b/modules/video/src/optical_flow_io.cpp @@ -52,12 +52,12 @@ CV_EXPORTS_W Mat readOpticalFlow( const String& path ) Mat_ flow; std::ifstream file(path.c_str(), std::ios_base::binary); if ( !file.good() ) - return std::move(flow); // no file - return empty matrix + return Mat(); // no file - return empty matrix float tag; file.read((char*) &tag, sizeof(float)); if ( tag != FLOW_TAG_FLOAT ) - return std::move(flow); + return Mat(); int width, height; @@ -76,14 +76,14 @@ CV_EXPORTS_W Mat readOpticalFlow( const String& path ) if ( !file.good() ) { flow.release(); - return std::move(flow); + return Mat(); } flow(i, j) = u; } } file.close(); - return std::move(flow); + return Mat(flow); } CV_EXPORTS_W bool writeOpticalFlow( const String& path, InputArray flow )