# Why would all these warnings happen?

**URL:** <https://forum.opencv.org/t/why-would-all-these-warnings-happen/19718>\
**Category:** C++\
**Tags:** build, programming\
**Created:** [January 9, 2025, 12:59pm UTC](https://forum.opencv.org/t/why-would-all-these-warnings-happen/19718 "2025-01-09T12:59:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![UnlimitedR](https://avatars.discourse-cdn.com/v4/letter/u/e9bcb4/32.png) [@UnlimitedR](https://forum.opencv.org/u/UnlimitedR)\
**Post date:** [January 9, 2025, 12:59pm UTC](https://forum.opencv.org/t/why-would-all-these-warnings-happen/19718/1 "2025-01-09T12:59:07Z")

</div>

```bash
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const cv::Mat&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:103:57: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  103 | inline _InputArray::_InputArray(const Mat& m) { init(MAT+ACCESS_READ, &m); }
      | ~~~^~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const std::vector<cv::Mat>&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:104:83: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  104 | inline _InputArray::_InputArray(const std::vector<Mat>& vec) { init(STD_VECTOR_MAT+ACCESS_READ, &vec); }
      | ~~~~~~~~~~~~~~^~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const cv::UMat&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:105:59: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  105 | inline _InputArray::_InputArray(const UMat& m) { init(UMAT+ACCESS_READ, &m); }
      | ~~~~^~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const std::vector<cv::UMat>&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:106:85: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  106 | inline _InputArray::_InputArray(const std::vector<UMat>& vec) { init(STD_VECTOR_UMAT+ACCESS_READ, &vec); }
      | ~~~~~~~~~~~~~~~^~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const std::array<cv::Mat, _Nm>&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:118:22: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-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&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:148:21: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  148 | { init(CUDA_GPU_MAT + ACCESS_READ, &d_mat); }
      | ~~~~~~~~~~~~~^~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const std::vector<cv::cuda::GpuMat>&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:151:38: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  151 | { init(STD_VECTOR_CUDA_GPU_MAT + ACCESS_READ, &d_mat);}
      | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const cv::ogl::Buffer&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:154:22: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  154 | { init(OPENGL_BUFFER + ACCESS_READ, &buf); }
      | ~~~~~~~~~~~~~~^~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputArray::_InputArray(const cv::cuda::HostMem&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:157:22: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  157 | { init(CUDA_HOST_MEM + ACCESS_READ, &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: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-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&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:202:53: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  202 | inline _OutputArray::_OutputArray(Mat& m) { init(MAT+ACCESS_WRITE, &m); }
      | ~~~^~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(std::vector<cv::Mat>&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:203:80: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  203 | inline _OutputArray::_OutputArray(std::vector<Mat>& vec) { init(STD_VECTOR_MAT + ACCESS_WRITE, &vec); }
      | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(cv::UMat&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:204:56: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  204 | inline _OutputArray::_OutputArray(UMat& m) { init(UMAT + ACCESS_WRITE, &m); }
      | ~~~~~^~~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(std::vector<cv::UMat>&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:205:82: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  205 | inline _OutputArray::_OutputArray(std::vector<UMat>& vec) { init(STD_VECTOR_UMAT + ACCESS_WRITE, &vec); }
      | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(std::array<cv::Mat, _Nm>&)’:
/usr/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)); }
      | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(cv::cuda::GpuMat&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:272:21: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  272 | { init(CUDA_GPU_MAT + ACCESS_WRITE, &d_mat); }
      | ~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(std::vector<cv::cuda::GpuMat>&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:275:38: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  275 | { init(STD_VECTOR_CUDA_GPU_MAT + ACCESS_WRITE, &d_mat);}
      | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(cv::ogl::Buffer&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:278:22: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  278 | { init(OPENGL_BUFFER + ACCESS_WRITE, &buf); }
      | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_OutputArray::_OutputArray(cv::cuda::HostMem&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:281:22: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  281 | { init(CUDA_HOST_MEM + ACCESS_WRITE, &cuda_mem); }
      | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(cv::Mat&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:328:63: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  328 | inline _InputOutputArray::_InputOutputArray(Mat& m) { init(MAT+ACCESS_RW, &m); }
      | ~~~^~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(std::vector<cv::Mat>&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:329:89: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  329 | inline _InputOutputArray::_InputOutputArray(std::vector<Mat>& vec) { init(STD_VECTOR_MAT+ACCESS_RW, &vec); }
      | ~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(cv::UMat&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:330:65: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  330 | inline _InputOutputArray::_InputOutputArray(UMat& m) { init(UMAT+ACCESS_RW, &m); }
      | ~~~~^~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(std::vector<cv::UMat>&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:331:91: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  331 | inline _InputOutputArray::_InputOutputArray(std::vector<UMat>& vec) { init(STD_VECTOR_UMAT+ACCESS_RW, &vec); }
      | ~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(std::array<cv::Mat, _Nm>&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:343:22: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-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&)’:
/usr/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, &d_mat); }
      | ~~~~~~~~~~~~~^~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(cv::ogl::Buffer&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:401:22: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  401 | { init(OPENGL_BUFFER + ACCESS_RW, &buf); }
      | ~~~~~~~~~~~~~~^~~~~~~~~~~
/usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::_InputOutputArray::_InputOutputArray(cv::cuda::HostMem&)’:
/usr/include/opencv4/opencv2/core/mat.inl.hpp:404:22: warning: arithmetic between different enumeration types ‘cv::_InputArray::KindFlag’ and ‘cv::AccessFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
  404 | { init(CUDA_HOST_MEM + ACCESS_RW, &cuda_mem); }
      | ~~~~~~~~~~~~~~^~~~~~~~~~~

```

I was just trying to use the official package (libopencv-dev)

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [January 9, 2025, 2:17pm UTC](https://forum.opencv.org/t/why-would-all-these-warnings-happen/19718/2 "2025-01-09T14:17:08Z")

</div>

> [@UnlimitedR](#):
>
> libopencv-dev

that doesn’t sound official. that is some linux distribution’s package, that someone maintains who’s (likely) more affiliated with the linux distribution than with opencv.

the issue:

> <https://github.com/opencv/opencv/issues/20269>
>
> \##### System information (version)
> \- OpenCV =\> 4.5.1+dfsg-4
> \- OS =\> Debian S…id/Experimental
> \- Compiler =\> g++-11 (Debian 11.1.0-3) 11.1.0
> 
> \##### Detailed description
> 
> 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.
> 
> \`\`\`
> \-	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&)’:
> /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& m) { init(MAT+ACCESS\_READ, &m); }
> | ~~~^~~~~~~~~~~~
> /usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::\_InputArray::\_InputArray(const std::vector\<cv::Mat\>&)’:
> /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\<Mat\>& vec) { init(STD\_VECTOR\_MAT+ACCESS\_READ, &vec); }
> | ~~~~~~~~~~~~~~^~~~~~~~~~~~
> 
> /usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::\_InputArray::\_InputArray(const cv::UMat&)’:
> /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& m) { init(UMAT+ACCESS\_READ, &m); }
> | ~~~~^~~~~~~~~~~~
> /usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::\_InputArray::\_InputArray(const std::vector\<cv::UMat\>&)’:
> /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\<UMat\>& vec) { init(STD\_VECTOR\_UMAT+ACCESS\_READ, &vec); }
> | ~~~~~~~~~~~~~~~^~~~~~~~~~~~
> 
> /usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::\_InputArray::\_InputArray(const std::array\<cv::Mat, \_Nm\>&)’:
> /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&)’:
> /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, &d\_mat); }
> | ~~~~~~~~~~~~~^~~~~~~~~~~~~
> /usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::\_InputArray::\_InputArray(const std::vector\<cv::cuda::GpuMat\>&)’:
> /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, &d\_mat);}
> | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
> /usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::\_InputArray::\_InputArray(const cv::ogl::Buffer&)’:
> /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, &buf); }
> | ~~~~~~~~~~~~~~^~~~~~~~~~~~~
> /usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::\_InputArray::\_InputArray(const cv::cuda::HostMem&)’:
> /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, &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&)’:
> /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& m) { init(MAT+ACCESS\_WRITE, &m); }
> | ~~~^~~~~~~~~~~~~
> /usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::\_OutputArray::\_OutputArray(std::vector\<cv::Mat\>&)’:
> /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\<Mat\>& vec) { init(STD\_VECTOR\_MAT + ACCESS\_WRITE, &vec); }
> | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
> 
> /usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::\_OutputArray::\_OutputArray(cv::UMat&)’:
> /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& m) { init(UMAT + ACCESS\_WRITE, &m); }
> | ~~~~~^~~~~~~~~~~~~~
> /usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::\_OutputArray::\_OutputArray(std::vector\<cv::UMat\>&)’:
> /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\<UMat\>& vec) { init(STD\_VECTOR\_UMAT + ACCESS\_WRITE, &vec); }
> | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
> 
> /usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::\_OutputArray::\_OutputArray(std::array\<cv::Mat, \_Nm\>&)’:
> /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&)’:
> /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, &d\_mat); }
> | ~~~~~~~~~~~~~^~~~~~~~~~~~~~
> /usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::\_OutputArray::\_OutputArray(std::vector\<cv::cuda::GpuMat\>&)’:
> /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, &d\_mat);}
> | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
> /usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::\_OutputArray::\_OutputArray(cv::ogl::Buffer&)’:
> /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, &buf); }
> | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~
> /usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::\_OutputArray::\_OutputArray(cv::cuda::HostMem&)’:
> /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, &cuda\_mem); }
> | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~
> /usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::\_InputOutputArray::\_InputOutputArray(cv::Mat&)’:
> /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& m) { init(MAT+ACCESS\_RW, &m); }
> | ~~~^~~~~~~~~~
> /usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::\_InputOutputArray::\_InputOutputArray(std::vector\<cv::Mat\>&)’:
> /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\<Mat\>& vec) { init(STD\_VECTOR\_MAT+ACCESS\_RW, &vec); }
> | ~~~~~~~~~~~~~~^~~~~~~~~~
> 
> /usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::\_InputOutputArray::\_InputOutputArray(cv::UMat&)’:
> /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& m) { init(UMAT+ACCESS\_RW, &m); }
> | ~~~~^~~~~~~~~~
> /usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::\_InputOutputArray::\_InputOutputArray(std::vector\<cv::UMat\>&)’:
> /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\<UMat\>& vec) { init(STD\_VECTOR\_UMAT+ACCESS\_RW, &vec); }
> | ~~~~~~~~~~~~~~~^~~~~~~~~~
> 
> /usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::\_InputOutputArray::\_InputOutputArray(std::array\<cv::Mat, \_Nm\>&)’:
> /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&)’:
> /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, &d\_mat); }
> | ~~~~~~~~~~~~~^~~~~~~~~~~
> /usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::\_InputOutputArray::\_InputOutputArray(cv::ogl::Buffer&)’:
> /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, &buf); }
> | ~~~~~~~~~~~~~~^~~~~~~~~~~
> /usr/include/opencv4/opencv2/core/mat.inl.hpp: In constructor ‘cv::\_InputOutputArray::\_InputOutputArray(cv::cuda::HostMem&)’:
> /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, &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::\<unnamed enum\>’ and ‘cv::\<unnamed enum\>’ 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::\<unnamed enum\>’ and ‘cv::\<unnamed enum\>’ 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::\<unnamed enum\>’ and ‘cv::\<unnamed enum\>’ 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::\<unnamed enum\>’ and ‘cv::\<unnamed enum\>’ 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::\<unnamed enum\>’ and ‘cv::\<unnamed enum\>’ 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::\<unnamed enum\>’ and ‘cv::\<unnamed enum\>’ 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::\<unnamed enum\>’ and ‘cv::\<unnamed enum\>’ 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\<\_Tp, m, n\>&, 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::\<unnamed enum\>’ and ‘cv::traits::Type\<double\>::\<unnamed enum\>’ is deprecated \[-Werror=deprecated-enum-enum-conversion\]
> 533 | : flags(MAGIC\_VAL + traits::Type\<\_Tp\>::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
> \`\`\`
> 
> \##### Steps to reproduce
> 
> I compile with \`-Wall -Wextra -Werror\`. Including that header, using those warnings/errors, and the latest g++ should be enough to trigger the error.
> 
> \##### Issue submission checklist
> 
> - \[x\] I report the issue, it's not a question
> - \[x\] I checked the problem with documentation, FAQ, open issues,
> forum.opencv.org, Stack Overflow, etc and have not found solution
> BTW, I found this similar report: https://stackoverflow.com/questions/63601869/error-in-compiling-opencv-program-with-g-and-clang
> - \[\] I updated to latest OpenCV version and the issue is still there
> - \[\] There is reproducer code and related data files: videos, images, onnx, etc
> --\>

---

<div class="post-metadata">

**Author:** ![UnlimitedR](https://avatars.discourse-cdn.com/v4/letter/u/e9bcb4/32.png) [@UnlimitedR](https://forum.opencv.org/u/UnlimitedR)\
**Post date:** [January 10, 2025, 4:02am UTC](https://forum.opencv.org/t/why-would-all-these-warnings-happen/19718/4 "2025-01-10T04:02:49Z")

</div>

Do you mean I’d better build from source myself? I think that might be too much work

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [January 10, 2025, 9:58am UTC](https://forum.opencv.org/t/why-would-all-these-warnings-happen/19718/5 "2025-01-10T09:58:02Z")

</div>

what exactly did you do to get these warnings?
