Skip to content

Commit

Permalink
meson: Deprecate bitwise operations between different enumeration type
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Umang Jain <[email protected]>
Reviewed-by: Stefan Klug <[email protected]>
  • Loading branch information
pinchartl committed May 3, 2024
1 parent 4885f2d commit bf46952
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit bf46952

Please sign in to comment.