summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-05-03 02:44:11 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-05-03 17:58:44 +0300
commitbf4695266bfca8cc21bcf10a3281e874ebce0d27 (patch)
tree6c6772baa1a1fcbb7798cee751a1d7ff8a4a8be9 /meson.build
parent4885f2d70d71f92d505cb33738dd592727cd036c (diff)
meson: Deprecate bitwise operations between different enumeration type
C++20 deprecates bitwise operations between different enumeration types. This is a bad practice even in C++17, so enable the deprecation warning. Doing so ensures no such operations will be added. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build9
1 files changed, 9 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 39e4947f..89320adb 100644
--- a/meson.build
+++ b/meson.build
@@ -178,6 +178,15 @@ if cc.has_argument('-Wno-c99-designator')
]
endif
+# Enable the C++20 deprecated enum-enum conversion warning if the compiler
+# supports it. This helps avoiding C++20 regressions, and should be removed
+# when switching to C++20 as the warning will then be enabled by default.
+if cxx.has_argument('-Wdeprecated-enum-enum-conversion')
+ cpp_arguments += [
+ '-Wdeprecated-enum-enum-conversion',
+ ]
+endif
+
c_arguments += common_arguments
cpp_arguments += common_arguments