[libdvdnav-devel] [Git][videolan/libdvdread][master] 6 commits: CI: compile with warning level 2

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Fri Jul 17 10:17:32 UTC 2026



Jean-Baptiste Kempf pushed to branch master at VideoLAN / libdvdread


Commits:
a1b6a9b9 by Steve Lhomme at 2026-07-17T11:51:49+02:00
CI: compile with warning level 2

The default value is 1 [^1] which corresponds to -Wall [^2].
Level 2 adds `-Wextra`.

[^1]: https://mesonbuild.com/Builtin-options.html#core-options
[^2]: https://mesonbuild.com/Builtin-options.html#details-for-warning_level

- - - - -
3b7aa3e0 by Steve Lhomme at 2026-07-17T11:51:49+02:00
CI: compile Debian with warning level 3

So we can see more potential issues.

- - - - -
b5e52810 by Steve Lhomme at 2026-07-17T11:51:49+02:00
CI: add an arm macos target with a newer runner

The x86_64 will soon die at Apple.

- - - - -
5e4d5a8b by Steve Lhomme at 2026-07-17T11:51:49+02:00
meson: add more sanity warnings

Based on the ones to check common errors in VLC.

- - - - -
f82ae764 by Steve Lhomme at 2026-07-17T11:51:49+02:00
meson: add an option to generate errors on common C code issues

Taken from the list in VLC.
This is off by default

- - - - -
d973c0f4 by Steve Lhomme at 2026-07-17T11:51:49+02:00
CI: build some targets with extra compiler checks

Developers should compile with this flag to find potential code issues.

- - - - -


3 changed files:

- .gitlab-ci.yml
- meson.build
- meson_options.txt


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -11,7 +11,7 @@ build-debian:
         - docker
         - amd64
     script:
-        - meson setup build
+        - meson setup build -Dwarning_level=3 -Dextra_checks=true
         - meson compile -C build
 
 build-raspberry:
@@ -35,7 +35,15 @@ build-macos:
         - amd64
         - macos
     script:
-        - meson setup build
+        - meson setup build -Dwarning_level=2 -Dextra_checks=true
+        - meson compile -C build
+
+build-macos-arm:
+    stage: build
+    tags:
+        - macos-xcode26
+    script:
+        - meson setup build -Dwarning_level=2 -Dextra_checks=true
         - meson compile -C build
 
 build-win:
@@ -45,7 +53,7 @@ build-win:
         - docker
         - amd64
     script:
-        - meson setup build --cross-file package/crossfiles/${CROSSFILE}.meson
+        - meson setup build -Dwarning_level=2 --cross-file package/crossfiles/${CROSSFILE}.meson
         - meson compile -C build
     parallel:
         matrix:
@@ -59,7 +67,7 @@ build-win-arm:
         - docker
         - amd64
     script:
-        - meson setup build --cross-file package/crossfiles/${CROSSFILE}.meson
+        - meson setup build -Dwarning_level=2 --cross-file package/crossfiles/${CROSSFILE}.meson
         - meson compile -C build
     parallel:
         matrix:
@@ -72,7 +80,7 @@ build-win-uwp:
         - docker
         - amd64
     script:
-        - meson setup build --cross-file package/crossfiles/${CROSSFILE}.meson
+        - meson setup build -Dwarning_level=2 --cross-file package/crossfiles/${CROSSFILE}.meson
         - meson compile -C build
     parallel:
         matrix:
@@ -87,5 +95,5 @@ build-wasm:
     script:
         - source $EMSCRIPTEN_SDK/emsdk_env.sh
         - export EM_CACHE=`em-config CACHE`
-        - meson setup build --cross-file package/crossfiles/wasm-unknown-emscripten.meson
+        - meson setup build -Dwarning_level=2 --cross-file package/crossfiles/wasm-unknown-emscripten.meson
         - meson compile -C build


=====================================
meson.build
=====================================
@@ -112,8 +112,40 @@ endif
 # But when the compiler does not supports them
 # it is not an error and silently tolerated
 
-if get_option('warning_level') in ['2', '3', 'everything']
-    optional_arguments += '-Wsign-compare'
+if get_option('warning_level') in ['2', '3', 'everything'] or get_option('extra_checks')
+    optional_arguments += [
+        '-Wsign-compare',
+        '-Wundef',
+        '-Wpointer-arith',
+        '-Wvolatile-register-var',
+        '-Wformat',
+        '-Wformat-security',
+        '-Wduplicated-branches',
+        '-Wduplicated-cond',
+        '-Wbad-function-cast',
+        '-Wwrite-strings',
+        '-Wmissing-prototypes',
+        '-Winit-self',
+        '-Wlogical-op',
+        '-Wshadow=local',
+        '-Wmultistatement-macros',
+    ]
+endif
+
+if get_option('extra_checks')
+    optional_arguments += [
+        '-Werror-implicit-function-declaration',
+        '-Werror=missing-field-initializers',
+        '-Werror=format',
+        '-Werror=return-mismatch',
+        '-Werror=incompatible-pointer-types',
+        '-Werror=restrict',
+        '-Werror=int-conversion',
+        '-Werror=implicit-int',
+        '-Werror=declaration-missing-parameter-type',
+        '-Werror=excess-initializers',
+        '-Werror=unterminated-string-initialization',
+    ]
 endif
 
 add_project_arguments(cc.get_supported_arguments(optional_arguments), language: 'c')


=====================================
meson_options.txt
=====================================
@@ -20,3 +20,8 @@ option('dlfcn',
     choices: ['external', 'builtin', 'auto'],
     value: 'auto',
     description: 'Use external dlfcn for MinGW')
+
+option('extra_checks',
+    type : 'boolean',
+    value : false,
+    description : 'Turn some warnings into compilation error')



View it on GitLab: https://code.videolan.org/videolan/libdvdread/-/compare/abac4e274fa2dfcb9dfc6451cfb59618f196b854...d973c0f457b86c0ff59f8fe803427236b044f1c1

-- 
View it on GitLab: https://code.videolan.org/videolan/libdvdread/-/compare/abac4e274fa2dfcb9dfc6451cfb59618f196b854...d973c0f457b86c0ff59f8fe803427236b044f1c1
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the libdvdnav-devel mailing list