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

<ul dir="auto">
<li>OpenCV =&gt; 4.5.5</li>
<li>Operating System / Platform =&gt; Fedora 36</li>
<li>Compiler =&gt; GCC 12</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">The version is not building in the debug mode because of the <code class="notranslate">Werror=return-type</code> warning.</p>
<div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
/home/user/.conan/data/opencv/4.5.5/_/_/build/c2ecc42c4fd20695e9185b38647d6dcb62ef4a3a/source_subfolder/modules/gapi/src/compiler/gislandmodel.cpp: In member function 'ade::NodeHandle cv::gimpl::GIsland::producer(const ade::Graph&amp;, const ade::NodeHandle&amp;) const':
/home/user/.conan/data/opencv/4.5.5/_/_/build/c2ecc42c4fd20695e9185b38647d6dcb62ef4a3a/source_subfolder/modules/gapi/src/compiler/gislandmodel.cpp:124:1: error: control reaches end of non-void function [-Werror=return-type]
  124 | }
      | ^
"><pre class="notranslate">/home/user/.conan/data/opencv/<span class="pl-c1">4.5.5</span>/_/_/build/c2ecc42c4fd20695e9185b38647d6dcb62ef4a3a/source_subfolder/modules/gapi/src/compiler/gislandmodel.cpp: In member function <span class="pl-s"><span class="pl-pds">'</span>ade::NodeHandle cv::gimpl::GIsland::producer(const ade::Graph&amp;, const ade::NodeHandle&amp;) const<span class="pl-pds">'</span></span>:
/home/user/.conan/data/opencv/<span class="pl-c1">4.5.5</span>/_/_/build/c2ecc42c4fd20695e9185b38647d6dcb62ef4a3a/source_subfolder/modules/gapi/src/compiler/gislandmodel.cpp:<span class="pl-c1">124</span>:<span class="pl-c1">1</span>: error: control reaches end of non-<span class="pl-k">void</span> function [-Werror=<span class="pl-k">return</span>-type]
  <span class="pl-c1">124</span> | }
      | ^
</pre></div>
<h5 dir="auto">Steps to reproduce</h5>
<p dir="auto">Just compile with conan with <code class="notranslate">build_type</code> being <code class="notranslate">Debug</code>.</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"> 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"> 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"> There is reproducer code and related data files: videos, images, onnx, etc

</li>
</ul>
<p dir="auto">Compiler: GCC 12.1<br>
Warnings are related to <code class="notranslate">GAPI_Assert(false ...);</code> code.<br>
<code class="notranslate">GAPI_Error()</code> with "noreturn" attribute should be used instead.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[2464/3435] Building CXX object modules/gapi/CMakeFiles/opencv_gapi.dir/src/compiler/gislandmodel.cpp.o
/home/alalek/projects/opencv/dev/modules/gapi/src/compiler/gislandmodel.cpp: In member function ‘ade::NodeHandle cv::gimpl::GIsland::producer(const ade::Graph&amp;, const ade::NodeHandle&amp;) const’:
/home/alalek/projects/opencv/dev/modules/gapi/src/compiler/gislandmodel.cpp:124:1: warning: control reaches end of non-void function [-Wreturn-type]
  124 | }
      | ^
[2483/3435] Building CXX object modules/gapi/CMakeFiles/opencv_gapi.dir/src/executor/gstreamingexecutor.cpp.o
/home/alalek/projects/opencv/dev/modules/gapi/src/executor/gstreamingexecutor.cpp: In member function ‘bool cv::gimpl::GStreamingExecutor::pull(cv::GRunArgsP&amp;&amp;)’:
/home/alalek/projects/opencv/dev/modules/gapi/src/executor/gstreamingexecutor.cpp:1832:1: warning: control reaches end of non-void function [-Wreturn-type]
 1832 | }
      | ^
/home/alalek/projects/opencv/dev/modules/gapi/src/executor/gstreamingexecutor.cpp: In member function ‘bool cv::gimpl::GStreamingExecutor::pull(cv::GOptRunArgsP&amp;&amp;)’:
/home/alalek/projects/opencv/dev/modules/gapi/src/executor/gstreamingexecutor.cpp:1863:1: warning: control reaches end of non-void function [-Wreturn-type]
 1863 | }
      | ^
[2491/3435] Building CXX object modules/gapi/CMakeFiles/opencv_gapi.dir/src/backends/cpu/gcpustereo.cpp.o
In file included from /home/alalek/projects/opencv/dev/modules/core/include/opencv2/core/matx.hpp:52,
                 from /home/alalek/projects/opencv/dev/modules/core/include/opencv2/core/mat.hpp:51,
                 from /home/alalek/projects/opencv/dev/modules/gapi/include/opencv2/gapi/opencv_includes.hpp:13,
                 from /home/alalek/projects/opencv/dev/modules/gapi/include/opencv2/gapi/gmat.hpp:14,
                 from /home/alalek/projects/opencv/dev/modules/gapi/include/opencv2/gapi/stereo.hpp:10,
                 from /home/alalek/projects/opencv/dev/modules/gapi/src/backends/cpu/gcpustereo.cpp:7:
/home/alalek/projects/opencv/dev/modules/gapi/src/backends/cpu/gcpustereo.cpp: In static member function ‘static void GCPUStereo::run(const cv::Mat&amp;, const cv::Mat&amp;, cv::gapi::StereoOutputFormat, cv::Mat&amp;, const StereoSetup&amp;)’:
/home/alalek/projects/opencv/dev/modules/core/include/opencv2/core/base.hpp:342:32: warning: this statement may fall through [-Wimplicit-fallthrough=]
  342 | #define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
      |                                ^~
/home/alalek/projects/opencv/dev/modules/gapi/include/opencv2/gapi/own/assert.hpp:20:21: note: in expansion of macro ‘CV_Assert’
   20 | #define GAPI_Assert CV_Assert
      |                     ^~~~~~~~~
/home/alalek/projects/opencv/dev/modules/gapi/src/backends/cpu/gcpustereo.cpp:66:17: note: in expansion of macro ‘GAPI_Assert’
   66 |                 GAPI_Assert(false &amp;&amp; &quot;This case may be supported in future.&quot;);
      |                 ^~~~~~~~~~~
/home/alalek/projects/opencv/dev/modules/gapi/src/backends/cpu/gcpustereo.cpp:67:13: note: here
   67 |             default:
      |             ^~~~~~~"><pre class="notranslate"><code class="notranslate">[2464/3435] Building CXX object modules/gapi/CMakeFiles/opencv_gapi.dir/src/compiler/gislandmodel.cpp.o
/home/alalek/projects/opencv/dev/modules/gapi/src/compiler/gislandmodel.cpp: In member function ‘ade::NodeHandle cv::gimpl::GIsland::producer(const ade::Graph&amp;, const ade::NodeHandle&amp;) const’:
/home/alalek/projects/opencv/dev/modules/gapi/src/compiler/gislandmodel.cpp:124:1: warning: control reaches end of non-void function [-Wreturn-type]
  124 | }
      | ^
[2483/3435] Building CXX object modules/gapi/CMakeFiles/opencv_gapi.dir/src/executor/gstreamingexecutor.cpp.o
/home/alalek/projects/opencv/dev/modules/gapi/src/executor/gstreamingexecutor.cpp: In member function ‘bool cv::gimpl::GStreamingExecutor::pull(cv::GRunArgsP&amp;&amp;)’:
/home/alalek/projects/opencv/dev/modules/gapi/src/executor/gstreamingexecutor.cpp:1832:1: warning: control reaches end of non-void function [-Wreturn-type]
 1832 | }
      | ^
/home/alalek/projects/opencv/dev/modules/gapi/src/executor/gstreamingexecutor.cpp: In member function ‘bool cv::gimpl::GStreamingExecutor::pull(cv::GOptRunArgsP&amp;&amp;)’:
/home/alalek/projects/opencv/dev/modules/gapi/src/executor/gstreamingexecutor.cpp:1863:1: warning: control reaches end of non-void function [-Wreturn-type]
 1863 | }
      | ^
[2491/3435] Building CXX object modules/gapi/CMakeFiles/opencv_gapi.dir/src/backends/cpu/gcpustereo.cpp.o
In file included from /home/alalek/projects/opencv/dev/modules/core/include/opencv2/core/matx.hpp:52,
                 from /home/alalek/projects/opencv/dev/modules/core/include/opencv2/core/mat.hpp:51,
                 from /home/alalek/projects/opencv/dev/modules/gapi/include/opencv2/gapi/opencv_includes.hpp:13,
                 from /home/alalek/projects/opencv/dev/modules/gapi/include/opencv2/gapi/gmat.hpp:14,
                 from /home/alalek/projects/opencv/dev/modules/gapi/include/opencv2/gapi/stereo.hpp:10,
                 from /home/alalek/projects/opencv/dev/modules/gapi/src/backends/cpu/gcpustereo.cpp:7:
/home/alalek/projects/opencv/dev/modules/gapi/src/backends/cpu/gcpustereo.cpp: In static member function ‘static void GCPUStereo::run(const cv::Mat&amp;, const cv::Mat&amp;, cv::gapi::StereoOutputFormat, cv::Mat&amp;, const StereoSetup&amp;)’:
/home/alalek/projects/opencv/dev/modules/core/include/opencv2/core/base.hpp:342:32: warning: this statement may fall through [-Wimplicit-fallthrough=]
  342 | #define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
      |                                ^~
/home/alalek/projects/opencv/dev/modules/gapi/include/opencv2/gapi/own/assert.hpp:20:21: note: in expansion of macro ‘CV_Assert’
   20 | #define GAPI_Assert CV_Assert
      |                     ^~~~~~~~~
/home/alalek/projects/opencv/dev/modules/gapi/src/backends/cpu/gcpustereo.cpp:66:17: note: in expansion of macro ‘GAPI_Assert’
   66 |                 GAPI_Assert(false &amp;&amp; "This case may be supported in future.");
      |                 ^~~~~~~~~~~
/home/alalek/projects/opencv/dev/modules/gapi/src/backends/cpu/gcpustereo.cpp:67:13: note: here
   67 |             default:
      |             ^~~~~~~
</code></pre></div>