[v1,1/2] libcamera: base: regex: Fix preprocessor check
diff mbox series

Message ID 20260428084550.91669-1-barnabas.pocze@ideasonboard.com
State New
Headers show
Series
  • [v1,1/2] libcamera: base: regex: Fix preprocessor check
Related show

Commit Message

Barnabás Pőcze April 28, 2026, 8:45 a.m. UTC
clang has no `maybe-uninitialized` warning, therefore the suppression
will generate a compiler error. This was probably hidden by the fact that
`__SANITIZE_*__` macros have only been added to clang since llvm 22.

Link: https://github.com/llvm/llvm-project/commit/568c23bbd3303518c5056d7f03444dae4fdc8a9c
Fixes: b01918978c82 ("libcamera: v4l2_subdevice: Work around false positive warning")
Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 include/libcamera/base/regex.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/include/libcamera/base/regex.h b/include/libcamera/base/regex.h
index 45f4da8cb..c80cca6fe 100644
--- a/include/libcamera/base/regex.h
+++ b/include/libcamera/base/regex.h
@@ -8,7 +8,7 @@ 
 #include <libcamera/base/private.h>
 
 #pragma GCC diagnostic push
-#if defined __SANITIZE_ADDRESS__ && defined __OPTIMIZE__
+#if (defined(__GNUC__) && !defined(__clang__)) && defined __SANITIZE_ADDRESS__ && defined __OPTIMIZE__
 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
 #endif
 #include <regex>