<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; <code class="notranslate">4.5.5</code></li>
<li>Operating System / Platform =&gt; Ubuntu 21.10</li>
<li>Compiler =&gt; gcc (Ubuntu 11.2.0-7ubuntu2) <code class="notranslate">11.2.0</code></li>
</ul>
<h5 dir="auto">Detailed description</h5>

<p dir="auto">When compiling OpenCV 4.5.5 header files into a program that's been compiled with C++20 (using gcc <code class="notranslate">11.2.0</code>) we get flooded with warnings stating <code class="notranslate">-Wdeprecated-enum-enum-conversion</code>; e.g.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/usr/local/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(std::array&lt;cv::Mat, _Nm&gt;&amp;)’:
/usr/local/include/opencv4/opencv2/core/mat.inl.hpp:217:22: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  217 | { init(STD_ARRAY_MAT + ACCESS_WRITE, arr.data(), Size(1, _Nm)); }
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~"><pre class="notranslate"><code class="notranslate">/usr/local/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(std::array&lt;cv::Mat, _Nm&gt;&amp;)’:
/usr/local/include/opencv4/opencv2/core/mat.inl.hpp:217:22: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  217 | { init(STD_ARRAY_MAT + ACCESS_WRITE, arr.data(), Size(1, _Nm)); }
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~
</code></pre></div>
<p dir="auto">or</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/usr/local/include/opencv4/opencv2/videoio.hpp:309:80: warning: arithmetic between different enumeration types ‘cv::&lt;unnamed enum&gt;’ and ‘cv::&lt;unnamed enum&gt;’ is deprecated [-Wdeprecated-enum-enum-conversion]
  309 |        CAP_OPENNI_DEPTH_GENERATOR_BASELINE        = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_BASELINE,
      |                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~"><pre class="notranslate"><code class="notranslate">/usr/local/include/opencv4/opencv2/videoio.hpp:309:80: warning: arithmetic between different enumeration types ‘cv::&lt;unnamed enum&gt;’ and ‘cv::&lt;unnamed enum&gt;’ is deprecated [-Wdeprecated-enum-enum-conversion]
  309 |        CAP_OPENNI_DEPTH_GENERATOR_BASELINE        = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_BASELINE,
      |                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
</code></pre></div>
<p dir="auto">or</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/usr/local/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(cv::cuda::GpuMat&amp;)’:
/usr/local/include/opencv4/opencv2/core/mat.inl.hpp:398:21: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  398 | { init(CUDA_GPU_MAT + ACCESS_RW, &amp;d_mat); }
      |        ~~~~~~~~~~~~~^~~~~~~~~~~"><pre class="notranslate"><code class="notranslate">/usr/local/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(cv::cuda::GpuMat&amp;)’:
/usr/local/include/opencv4/opencv2/core/mat.inl.hpp:398:21: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  398 | { init(CUDA_GPU_MAT + ACCESS_RW, &amp;d_mat); }
      |        ~~~~~~~~~~~~~^~~~~~~~~~~
</code></pre></div>
<p dir="auto">etc</p>
<p dir="auto">I've looked for <code class="notranslate">Wdeprecated-enum-enum-conversion</code> on GitHub (issues, etc), found <a href="https://stackoverflow.com/questions/7124914/how-to-search-a-git-repository-by-commit-message" rel="nofollow">this StackOverflow question</a>, and searched the <code class="notranslate">git log</code> of <code class="notranslate">master</code> (for <code class="notranslate">enum</code> since the <code class="notranslate">4.5.5</code> release) but can't see any evidence for it being resolved. The only thing I have <em>not</em> done yet (that I'm aware might be helpful) is build from current <code class="notranslate">master</code> to compare.</p>
<h5 dir="auto">Steps to reproduce</h5>

<ul dir="auto">
<li>Compile OpenCV as per documentation</li>
<li>Use header files I've named above in your compilation</li>
</ul>
<h5 dir="auto">Issue submission checklist</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I report the issue, it's not a question

</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I checked the problem with documentation, FAQ, open issues,<br>
forum.opencv.org, Stack Overflow, etc and have not found any solution

</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I updated to the latest OpenCV version and the issue is still there

</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> There is reproducer code and related data files: videos, images, onnx, etc

</li>
</ul>
<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV =&gt;  4.5.1+dfsg-4</li>
<li>OS =&gt;  Debian Sid/Experimental</li>
<li>Compiler =&gt;  g++-11 (Debian 11.1.0-3) 11.1.0</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">When I upgraded my compiler to g++-11, just to see if some bug in gcc was already fixed, I found out a new one.  It started reporting an error from a system header, which may be even another bug in g++-11, but still, you might want to fix it in OpenCV anyway, so I'll report it here.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="-	CXX	$builddir/cv/alx/compare.cxx.s
In file included from /usr/include/opencv4/opencv2/core/mat.hpp:3723,
                 from /usr/include/opencv4/opencv2/core.hpp:59,
                 from /home/user/src/alx/libalx/src/cv/alx/compare.cxx:16:
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const cv::Mat&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:103:57: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  103 | inline _InputArray::_InputArray(const Mat&amp; m) { init(MAT+ACCESS_READ, &amp;m); }
      |                                                      ~~~^~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const std::vector&lt;cv::Mat&gt;&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:104:83: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  104 | nputArray::_InputArray(const std::vector&lt;Mat&gt;&amp; vec) { init(STD_VECTOR_MAT+ACCESS_READ, &amp;vec); }
      |                                                            ~~~~~~~~~~~~~~^~~~~~~~~~~~

/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const cv::UMat&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:105:59: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  105 | inline _InputArray::_InputArray(const UMat&amp; m) { init(UMAT+ACCESS_READ, &amp;m); }
      |                                                       ~~~~^~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const std::vector&lt;cv::UMat&gt;&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:106:85: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  106 | utArray::_InputArray(const std::vector&lt;UMat&gt;&amp; vec) { init(STD_VECTOR_UMAT+ACCESS_READ, &amp;vec); }
      |                                                           ~~~~~~~~~~~~~~~^~~~~~~~~~~~

/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const std::array&lt;cv::Mat, _Nm&gt;&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:118:22: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  118 | { init(STD_ARRAY_MAT + ACCESS_READ, arr.data(), Size(1, _Nm)); }
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const cv::cuda::GpuMat&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:148:21: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  148 | { init(CUDA_GPU_MAT + ACCESS_READ, &amp;d_mat); }
      |        ~~~~~~~~~~~~~^~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const std::vector&lt;cv::cuda::GpuMat&gt;&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:151:38: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  151 | {       init(STD_VECTOR_CUDA_GPU_MAT + ACCESS_READ, &amp;d_mat);}
      |              ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const cv::ogl::Buffer&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:154:22: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  154 | { init(OPENGL_BUFFER + ACCESS_READ, &amp;buf); }
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const cv::cuda::HostMem&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:157:22: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  157 | { init(CUDA_HOST_MEM + ACCESS_READ, &amp;cuda_mem); }
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray()’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:200:49: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  200 | inline _OutputArray::_OutputArray() { init(NONE + ACCESS_WRITE, 0); }
      |                                            ~~~~~^~~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(cv::Mat&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:202:53: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  202 | inline _OutputArray::_OutputArray(Mat&amp; m) { init(MAT+ACCESS_WRITE, &amp;m); }
      |                                                  ~~~^~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(std::vector&lt;cv::Mat&gt;&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:203:80: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  203 |  _OutputArray::_OutputArray(std::vector&lt;Mat&gt;&amp; vec) { init(STD_VECTOR_MAT + ACCESS_WRITE, &amp;vec); }
      |                                                           ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~

/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(cv::UMat&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:204:56: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  204 | inline _OutputArray::_OutputArray(UMat&amp; m) { init(UMAT + ACCESS_WRITE, &amp;m); }
      |                                                   ~~~~~^~~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(std::vector&lt;cv::UMat&gt;&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:205:82: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  205 | OutputArray::_OutputArray(std::vector&lt;UMat&gt;&amp; vec) { init(STD_VECTOR_UMAT + ACCESS_WRITE, &amp;vec); }
      |                                                          ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~

/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(std::array&lt;cv::Mat, _Nm&gt;&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:217:22: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  217 | { init(STD_ARRAY_MAT + ACCESS_WRITE, arr.data(), Size(1, _Nm)); }
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(cv::cuda::GpuMat&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:272:21: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  272 | { init(CUDA_GPU_MAT + ACCESS_WRITE, &amp;d_mat); }
      |        ~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(std::vector&lt;cv::cuda::GpuMat&gt;&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:275:38: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  275 | {       init(STD_VECTOR_CUDA_GPU_MAT + ACCESS_WRITE, &amp;d_mat);}
      |              ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(cv::ogl::Buffer&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:278:22: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  278 | { init(OPENGL_BUFFER + ACCESS_WRITE, &amp;buf); }
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(cv::cuda::HostMem&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:281:22: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  281 | { init(CUDA_HOST_MEM + ACCESS_WRITE, &amp;cuda_mem); }
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(cv::Mat&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:328:63: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  328 | inline _InputOutputArray::_InputOutputArray(Mat&amp; m) { init(MAT+ACCESS_RW, &amp;m); }
      |                                                            ~~~^~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(std::vector&lt;cv::Mat&gt;&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:329:89: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  329 | tputArray::_InputOutputArray(std::vector&lt;Mat&gt;&amp; vec) { init(STD_VECTOR_MAT+ACCESS_RW, &amp;vec); }
      |                                                            ~~~~~~~~~~~~~~^~~~~~~~~~

/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(cv::UMat&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:330:65: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  330 | inline _InputOutputArray::_InputOutputArray(UMat&amp; m) { init(UMAT+ACCESS_RW, &amp;m); }
      |                                                             ~~~~^~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(std::vector&lt;cv::UMat&gt;&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:331:91: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  331 | utArray::_InputOutputArray(std::vector&lt;UMat&gt;&amp; vec) { init(STD_VECTOR_UMAT+ACCESS_RW, &amp;vec); }
      |                                                           ~~~~~~~~~~~~~~~^~~~~~~~~~

/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(std::array&lt;cv::Mat, _Nm&gt;&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:343:22: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  343 | { init(STD_ARRAY_MAT + ACCESS_RW, arr.data(), Size(1, _Nm)); }
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(cv::cuda::GpuMat&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:398:21: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  398 | { init(CUDA_GPU_MAT + ACCESS_RW, &amp;d_mat); }
      |        ~~~~~~~~~~~~~^~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(cv::ogl::Buffer&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:401:22: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  401 | { init(OPENGL_BUFFER + ACCESS_RW, &amp;buf); }
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(cv::cuda::HostMem&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:404:22: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  404 | { init(CUDA_HOST_MEM + ACCESS_RW, &amp;cuda_mem); }
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~
In file included from /usr/include/opencv4/opencv2/highgui.hpp:51,
                 from /home/user/src/alx/libalx/src/cv/alx/compare.cxx:27:
/usr/include/opencv4/opencv2/videoio.hpp: At global scope:
/usr/include/opencv4/opencv2/videoio.hpp:254:80: error: arithmetic between different enumeration types ‘cv::&lt;unnamed enum&gt;’ and ‘cv::&lt;unnamed enum&gt;’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  254 |  CAP_OPENNI_IMAGE_GENERATOR_PRESENT         = CAP_OPENNI_IMAGE_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT,
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/usr/include/opencv4/opencv2/videoio.hpp:255:80: error: arithmetic between different enumeration types ‘cv::&lt;unnamed enum&gt;’ and ‘cv::&lt;unnamed enum&gt;’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  255 |  CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE     = CAP_OPENNI_IMAGE_GENERATOR + CAP_PROP_OPENNI_OUTPUT_MODE,
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/usr/include/opencv4/opencv2/videoio.hpp:256:80: error: arithmetic between different enumeration types ‘cv::&lt;unnamed enum&gt;’ and ‘cv::&lt;unnamed enum&gt;’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  256 |  CAP_OPENNI_DEPTH_GENERATOR_PRESENT         = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT,
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/usr/include/opencv4/opencv2/videoio.hpp:257:80: error: arithmetic between different enumeration types ‘cv::&lt;unnamed enum&gt;’ and ‘cv::&lt;unnamed enum&gt;’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  257 |  CAP_OPENNI_DEPTH_GENERATOR_BASELINE        = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_BASELINE,
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~

/usr/include/opencv4/opencv2/videoio.hpp:258:80: error: arithmetic between different enumeration types ‘cv::&lt;unnamed enum&gt;’ and ‘cv::&lt;unnamed enum&gt;’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  258 |  CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH    = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_FOCAL_LENGTH,
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/usr/include/opencv4/opencv2/videoio.hpp:259:80: error: arithmetic between different enumeration types ‘cv::&lt;unnamed enum&gt;’ and ‘cv::&lt;unnamed enum&gt;’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  259 |  CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION    = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_REGISTRATION,
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/usr/include/opencv4/opencv2/videoio.hpp:261:77: error: arithmetic between different enumeration types ‘cv::&lt;unnamed enum&gt;’ and ‘cv::&lt;unnamed enum&gt;’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  261 |     CAP_OPENNI_IR_GENERATOR_PRESENT            = CAP_OPENNI_IR_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT,
      |                                                  ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from /usr/include/opencv4/opencv2/core/mat.hpp:3723,
                 from /usr/include/opencv4/opencv2/core.hpp:59,
                 from /home/user/src/alx/libalx/src/cv/alx/compare.cxx:16:
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In instantiation of ‘cv::Mat::Mat(const cv::Matx&lt;_Tp, m, n&gt;&amp;, bool) [with _Tp = double; int m = 2; int n = 3]’:
/usr/include/opencv4/opencv2/imgproc.hpp:2445:64:   required from here
/usr/include/opencv4/opencv2/core/mat.inl.hpp:533:23: error: arithmetic between different enumeration types ‘cv::Mat::&lt;unnamed enum&gt;’ and ‘cv::traits::Type&lt;double&gt;::&lt;unnamed enum&gt;’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  533 |     : flags(MAGIC_VAL + traits::Type&lt;_Tp&gt;::value + CV_MAT_CONT_FLAG), dims(2), rows(m), cols(n), data(0),
      |             ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [/home/user/src/alx/libalx/lib/recipes.inc.mk:53: /home/user/src/alx/libalx/tmp/cv/alx/compare.cxx.s] Error 1
make: *** [Makefile:72: cv] Error 2"><pre class="notranslate"><code class="notranslate">-	CXX	$builddir/cv/alx/compare.cxx.s
In file included from /usr/include/opencv4/opencv2/core/mat.hpp:3723,
                 from /usr/include/opencv4/opencv2/core.hpp:59,
                 from /home/user/src/alx/libalx/src/cv/alx/compare.cxx:16:
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const cv::Mat&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:103:57: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  103 | inline _InputArray::_InputArray(const Mat&amp; m) { init(MAT+ACCESS_READ, &amp;m); }
      |                                                      ~~~^~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const std::vector&lt;cv::Mat&gt;&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:104:83: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  104 | nputArray::_InputArray(const std::vector&lt;Mat&gt;&amp; vec) { init(STD_VECTOR_MAT+ACCESS_READ, &amp;vec); }
      |                                                            ~~~~~~~~~~~~~~^~~~~~~~~~~~

/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const cv::UMat&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:105:59: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  105 | inline _InputArray::_InputArray(const UMat&amp; m) { init(UMAT+ACCESS_READ, &amp;m); }
      |                                                       ~~~~^~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const std::vector&lt;cv::UMat&gt;&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:106:85: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  106 | utArray::_InputArray(const std::vector&lt;UMat&gt;&amp; vec) { init(STD_VECTOR_UMAT+ACCESS_READ, &amp;vec); }
      |                                                           ~~~~~~~~~~~~~~~^~~~~~~~~~~~

/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const std::array&lt;cv::Mat, _Nm&gt;&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:118:22: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  118 | { init(STD_ARRAY_MAT + ACCESS_READ, arr.data(), Size(1, _Nm)); }
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const cv::cuda::GpuMat&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:148:21: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  148 | { init(CUDA_GPU_MAT + ACCESS_READ, &amp;d_mat); }
      |        ~~~~~~~~~~~~~^~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const std::vector&lt;cv::cuda::GpuMat&gt;&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:151:38: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  151 | {       init(STD_VECTOR_CUDA_GPU_MAT + ACCESS_READ, &amp;d_mat);}
      |              ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const cv::ogl::Buffer&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:154:22: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  154 | { init(OPENGL_BUFFER + ACCESS_READ, &amp;buf); }
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const cv::cuda::HostMem&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:157:22: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  157 | { init(CUDA_HOST_MEM + ACCESS_READ, &amp;cuda_mem); }
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray()’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:200:49: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  200 | inline _OutputArray::_OutputArray() { init(NONE + ACCESS_WRITE, 0); }
      |                                            ~~~~~^~~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(cv::Mat&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:202:53: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  202 | inline _OutputArray::_OutputArray(Mat&amp; m) { init(MAT+ACCESS_WRITE, &amp;m); }
      |                                                  ~~~^~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(std::vector&lt;cv::Mat&gt;&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:203:80: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  203 |  _OutputArray::_OutputArray(std::vector&lt;Mat&gt;&amp; vec) { init(STD_VECTOR_MAT + ACCESS_WRITE, &amp;vec); }
      |                                                           ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~

/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(cv::UMat&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:204:56: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  204 | inline _OutputArray::_OutputArray(UMat&amp; m) { init(UMAT + ACCESS_WRITE, &amp;m); }
      |                                                   ~~~~~^~~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(std::vector&lt;cv::UMat&gt;&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:205:82: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  205 | OutputArray::_OutputArray(std::vector&lt;UMat&gt;&amp; vec) { init(STD_VECTOR_UMAT + ACCESS_WRITE, &amp;vec); }
      |                                                          ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~

/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(std::array&lt;cv::Mat, _Nm&gt;&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:217:22: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  217 | { init(STD_ARRAY_MAT + ACCESS_WRITE, arr.data(), Size(1, _Nm)); }
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(cv::cuda::GpuMat&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:272:21: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  272 | { init(CUDA_GPU_MAT + ACCESS_WRITE, &amp;d_mat); }
      |        ~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(std::vector&lt;cv::cuda::GpuMat&gt;&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:275:38: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  275 | {       init(STD_VECTOR_CUDA_GPU_MAT + ACCESS_WRITE, &amp;d_mat);}
      |              ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(cv::ogl::Buffer&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:278:22: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  278 | { init(OPENGL_BUFFER + ACCESS_WRITE, &amp;buf); }
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(cv::cuda::HostMem&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:281:22: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  281 | { init(CUDA_HOST_MEM + ACCESS_WRITE, &amp;cuda_mem); }
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(cv::Mat&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:328:63: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  328 | inline _InputOutputArray::_InputOutputArray(Mat&amp; m) { init(MAT+ACCESS_RW, &amp;m); }
      |                                                            ~~~^~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(std::vector&lt;cv::Mat&gt;&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:329:89: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  329 | tputArray::_InputOutputArray(std::vector&lt;Mat&gt;&amp; vec) { init(STD_VECTOR_MAT+ACCESS_RW, &amp;vec); }
      |                                                            ~~~~~~~~~~~~~~^~~~~~~~~~

/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(cv::UMat&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:330:65: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  330 | inline _InputOutputArray::_InputOutputArray(UMat&amp; m) { init(UMAT+ACCESS_RW, &amp;m); }
      |                                                             ~~~~^~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(std::vector&lt;cv::UMat&gt;&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:331:91: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  331 | utArray::_InputOutputArray(std::vector&lt;UMat&gt;&amp; vec) { init(STD_VECTOR_UMAT+ACCESS_RW, &amp;vec); }
      |                                                           ~~~~~~~~~~~~~~~^~~~~~~~~~

/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(std::array&lt;cv::Mat, _Nm&gt;&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:343:22: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  343 | { init(STD_ARRAY_MAT + ACCESS_RW, arr.data(), Size(1, _Nm)); }
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(cv::cuda::GpuMat&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:398:21: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  398 | { init(CUDA_GPU_MAT + ACCESS_RW, &amp;d_mat); }
      |        ~~~~~~~~~~~~~^~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(cv::ogl::Buffer&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:401:22: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  401 | { init(OPENGL_BUFFER + ACCESS_RW, &amp;buf); }
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(cv::cuda::HostMem&amp;)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:404:22: error: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  404 | { init(CUDA_HOST_MEM + ACCESS_RW, &amp;cuda_mem); }
      |        ~~~~~~~~~~~~~~^~~~~~~~~~~
In file included from /usr/include/opencv4/opencv2/highgui.hpp:51,
                 from /home/user/src/alx/libalx/src/cv/alx/compare.cxx:27:
/usr/include/opencv4/opencv2/videoio.hpp: At global scope:
/usr/include/opencv4/opencv2/videoio.hpp:254:80: error: arithmetic between different enumeration types ‘cv::&lt;unnamed enum&gt;’ and ‘cv::&lt;unnamed enum&gt;’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  254 |  CAP_OPENNI_IMAGE_GENERATOR_PRESENT         = CAP_OPENNI_IMAGE_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT,
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/usr/include/opencv4/opencv2/videoio.hpp:255:80: error: arithmetic between different enumeration types ‘cv::&lt;unnamed enum&gt;’ and ‘cv::&lt;unnamed enum&gt;’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  255 |  CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE     = CAP_OPENNI_IMAGE_GENERATOR + CAP_PROP_OPENNI_OUTPUT_MODE,
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/usr/include/opencv4/opencv2/videoio.hpp:256:80: error: arithmetic between different enumeration types ‘cv::&lt;unnamed enum&gt;’ and ‘cv::&lt;unnamed enum&gt;’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  256 |  CAP_OPENNI_DEPTH_GENERATOR_PRESENT         = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT,
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/usr/include/opencv4/opencv2/videoio.hpp:257:80: error: arithmetic between different enumeration types ‘cv::&lt;unnamed enum&gt;’ and ‘cv::&lt;unnamed enum&gt;’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  257 |  CAP_OPENNI_DEPTH_GENERATOR_BASELINE        = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_BASELINE,
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~

/usr/include/opencv4/opencv2/videoio.hpp:258:80: error: arithmetic between different enumeration types ‘cv::&lt;unnamed enum&gt;’ and ‘cv::&lt;unnamed enum&gt;’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  258 |  CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH    = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_FOCAL_LENGTH,
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/usr/include/opencv4/opencv2/videoio.hpp:259:80: error: arithmetic between different enumeration types ‘cv::&lt;unnamed enum&gt;’ and ‘cv::&lt;unnamed enum&gt;’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  259 |  CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION    = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_REGISTRATION,
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/usr/include/opencv4/opencv2/videoio.hpp:261:77: error: arithmetic between different enumeration types ‘cv::&lt;unnamed enum&gt;’ and ‘cv::&lt;unnamed enum&gt;’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  261 |     CAP_OPENNI_IR_GENERATOR_PRESENT            = CAP_OPENNI_IR_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT,
      |                                                  ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from /usr/include/opencv4/opencv2/core/mat.hpp:3723,
                 from /usr/include/opencv4/opencv2/core.hpp:59,
                 from /home/user/src/alx/libalx/src/cv/alx/compare.cxx:16:
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In instantiation of ‘cv::Mat::Mat(const cv::Matx&lt;_Tp, m, n&gt;&amp;, bool) [with _Tp = double; int m = 2; int n = 3]’:
/usr/include/opencv4/opencv2/imgproc.hpp:2445:64:   required from here
/usr/include/opencv4/opencv2/core/mat.inl.hpp:533:23: error: arithmetic between different enumeration types ‘cv::Mat::&lt;unnamed enum&gt;’ and ‘cv::traits::Type&lt;double&gt;::&lt;unnamed enum&gt;’ is deprecated [-Werror=deprecated-enum-enum-conversion]
  533 |     : flags(MAGIC_VAL + traits::Type&lt;_Tp&gt;::value + CV_MAT_CONT_FLAG), dims(2), rows(m), cols(n), data(0),
      |             ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [/home/user/src/alx/libalx/lib/recipes.inc.mk:53: /home/user/src/alx/libalx/tmp/cv/alx/compare.cxx.s] Error 1
make: *** [Makefile:72: cv] Error 2
</code></pre></div>
<h5 dir="auto">Steps to reproduce</h5>
<p dir="auto">I compile with <code class="notranslate">-Wall -Wextra -Werror</code>.  Including that header, using those warnings/errors, and the latest g++ should be enough to trigger the error.</p>
<h5 dir="auto">Issue submission checklist</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I report the issue, it's not a question</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I checked the problem with documentation, FAQ, open issues,<br>
forum.opencv.org, Stack Overflow, etc and have not found solution<br>
BTW, I found this similar report: <a href="https://stackoverflow.com/questions/63601869/error-in-compiling-opencv-program-with-g-and-clang" rel="nofollow">https://stackoverflow.com/questions/63601869/error-in-compiling-opencv-program-with-g-and-clang</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I updated to latest OpenCV version and the issue is still there</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> There is reproducer code and related data files: videos, images, onnx, etc<br>
--&gt;</li>
</ul>