You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Treat the CPU-only OpenCV GpuMat diagnostic as a deferred upstream warning: OpenCvSharp does not support CUDA and exposes no managed GpuMat class. No upstream PR is being submitted.
Use the existing OpenCV CMake hook to disable GCC's -Wnonnull only for modules/core/src/cuda_gpu_mat.cpp when CUDA is unavailable. Preserve that file's existing compile options. OpenCV implementation and runtime behavior are unchanged; all other translation units retain nonnull diagnostics.
Compile the unmodified CPU-only production source with GCC 13.4 and -Werror=nonnull: three diagnostics without the hook, zero with it.
Inspect generated compile commands: exactly one translation unit receives the suppression; the other 570 do not.
Build OpenCV core and OpenCvSharpExtern through their normal CMake targets in an Ubuntu 26.04 CPU-only Release build.
Verify production Docker full/slim and manylinux: both Docker jobs, all six native manylinux builds, and both architectures' test jobs pass. All eight native build logs actually recompile GpuMat and contain zero -Wnonnull diagnostics. Docker retains LAPACK in both profiles and MLAS in full, with zero managed test failures.
Summary by CodeRabbit
Chores
Updated build settings for GNU builds without CUDA to suppress a compiler warning. This change does not alter public interfaces or end-user functionality.
No actionable comments were generated in the recent review.
Walkthrough
The CMake hook adds -Wno-nonnull to cuda_gpu_mat.cpp when GNU is used, CUDA is unavailable, and opencv_core exists. It preserves any existing source compile options.
Changes: CMake warning configuration
Layer / File(s)
Summary
Set source compile option cmake/opencv-hooks/POST_FINALIZE.cmake
Under the specified build conditions, the hook appends -Wno-nonnull to the source's existing compile options.
Issue 2213: The change adds a source-specific suppression for the CPU-only GpuMat warning without globally disabling nonnull diagnostics.
Merge Risk: Minimal · up to c7505
This change only suppresses a GCC warning for one OpenCV source file in CPU-only builds. It does not alter runtime behavior, and other files keep their nonnull diagnostics. Merge risk is minimal.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: suppressing the upstream GpuMat warning (GCC -Wnonnull) and limiting that suppression to CPU-only GCC builds. The raw summary confirms the hook adds -Wno-nonnull for c…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check
Explanation
The title names the main change: suppressing the upstream GpuMat warning (GCC -Wnonnull) and limiting that suppression to CPU-only GCC builds. The raw summary confirms the hook adds -Wno-nonnull for cuda_gpu_mat.cpp only for GNU builds without CUDA when opencv_core exists. The PR objectives match this scope. The title is specific and accurate.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between d6222dd and c75052d.
Files selected for processing: 1
cmake/opencv-hooks/POST_FINALIZE.cmake
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Treat the CPU-only OpenCV GpuMat diagnostic as a deferred upstream warning: OpenCvSharp does not support CUDA and exposes no managed GpuMat class. No upstream PR is being submitted.
Use the existing OpenCV CMake hook to disable GCC's
-Wnonnullonly formodules/core/src/cuda_gpu_mat.cppwhen CUDA is unavailable. Preserve that file's existing compile options. OpenCV implementation and runtime behavior are unchanged; all other translation units retain nonnull diagnostics.Refs #2213.
Test plan
-Werror=nonnull: three diagnostics without the hook, zero with it.-Wnonnulldiagnostics. Docker retains LAPACK in both profiles and MLAS in full, with zero managed test failures.Summary by CodeRabbit