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

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Fri Jul 17 13:26:25 UTC 2026



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


Commits:
995ae5e5 by Steve Lhomme at 2026-07-17T13:05:58+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

- - - - -
26a04d8b by Steve Lhomme at 2026-07-17T13:06:18+02:00
CI: compile Debian with warning level 3

So we can see more potential issues.

- - - - -
6197cae1 by Steve Lhomme at 2026-07-17T13:07:57+02:00
CI: add an arm macos target with a newer runner

The x86_64 will soon die at Apple.

- - - - -
3d9ef0bf by Steve Lhomme at 2026-07-17T13:10:15+02:00
meson: add more sanity warnings

Based on the ones to check common errors in VLC.

- - - - -
1450b29f by Steve Lhomme at 2026-07-17T13:12:15+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

- - - - -
958ada45 by Steve Lhomme at 2026-07-17T13:14:59+02:00
CI: build some targets with extra compiler checks

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

- - - - -
2d9969f1 by Steve Lhomme at 2026-07-17T13:30:57+02:00
CI: build Windows ARM64 with a UCRT toolchain

We don't need msvcrt on that target.

- - - - -
b6d22075 by Steve Lhomme at 2026-07-17T13:31:52+02:00
CI: build wasm with the latest Docker image

- - - - -
09b3ae22 by Steve Lhomme at 2026-07-17T14:26:33+02:00
CI: build wasm with extra checks

- - - - -
e0c02b97 by Steve Lhomme at 2026-07-17T15:04:51+02:00
include dvdread headers before system headers

libdvdread needs to define _LARGEFILE64_SOURCE before sys/types.h is included.

- - - - -


15 changed files:

- .gitlab-ci.yml
- meson.build
- meson_options.txt
- src/dvdnav.c
- src/highlight.c
- src/navigation.c
- src/read_cache.c
- src/searching.c
- src/settings.c
- src/vm/decoder.c
- src/vm/getset.c
- src/vm/play.c
- src/vm/vm.c
- src/vm/vmcmd.c
- src/vm/vmget.c


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -12,7 +12,7 @@ build-debian:
         - amd64
     script:
         - git clone --branch master --depth 1 https://code.videolan.org/videolan/libdvdread.git subprojects/libdvdread
-        - meson setup build
+        - meson setup build -Dwarning_level=3 -Dextra_checks=true
         - meson compile -C build
 
 build-raspberry:
@@ -38,7 +38,16 @@ build-macos:
         - macos
     script:
         - git clone --branch master --depth 1 https://code.videolan.org/videolan/libdvdread.git subprojects/libdvdread
-        - meson setup build
+        - meson setup build -Dwarning_level=2
+        - meson compile -C build
+
+build-macos-warm:
+    stage: build
+    tags:
+        - macos-xcode26
+    script:
+        - git clone --branch master --depth 1 https://code.videolan.org/videolan/libdvdread.git subprojects/libdvdread
+        - meson setup build -Dwarning_level=2 -Dextra_checks=true
         - meson compile -C build
 
 build-win:
@@ -49,7 +58,7 @@ build-win:
         - amd64
     script:
         - git clone --branch master --depth 1 https://code.videolan.org/videolan/libdvdread.git subprojects/libdvdread
-        - meson setup build --cross-file package/crossfiles/${CROSSFILE}.meson
+        - meson setup build -Dwarning_level=2 -Dextra_checks=true --cross-file package/crossfiles/${CROSSFILE}.meson
         - meson compile -C build
     parallel:
         matrix:
@@ -57,21 +66,21 @@ build-win:
 
 
 build-win-arm:
-    image: registry.videolan.org/vlc-debian-llvm-msvcrt:20250305204125
+    image: registry.videolan.org/vlc-debian-llvm-ucrt:20260611225331
     stage: build
     tags:
         - docker
         - amd64
     script:
         - git clone --branch master --depth 1 https://code.videolan.org/videolan/libdvdread.git subprojects/libdvdread
-        - meson setup build --cross-file package/crossfiles/${CROSSFILE}.meson
+        - meson setup build -Dwarning_level=2 -Dextra_checks=true --cross-file package/crossfiles/${CROSSFILE}.meson
         - meson compile -C build
     parallel:
         matrix:
             - CROSSFILE: [armv7-w64-mingw32, aarch64-w64-mingw32]
 
 build-wasm:
-    image: registry.videolan.org/vlc-debian-wasm-emscripten:20250905104736
+    image: registry.videolan.org/vlc-debian-wasm-emscripten:20260617104340
     stage: build
     tags:
         - docker
@@ -80,6 +89,6 @@ build-wasm:
         - git clone --branch master --depth 1 https://code.videolan.org/videolan/libdvdread.git subprojects/libdvdread
         - 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 -Dextra_checks=true --cross-file package/crossfiles/wasm-unknown-emscripten.meson
         - meson compile -C build
 


=====================================
meson.build
=====================================
@@ -98,7 +98,37 @@ if cc.get_argument_syntax() != 'msvc'
     optional_arguments += [
         '-mno-ms-bitfields',
         '-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',
     ]
+
+    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
 endif
 
 add_project_arguments(cc.get_supported_arguments(optional_arguments), language: 'c')


=====================================
meson_options.txt
=====================================
@@ -12,3 +12,8 @@ option('enable_examples',
     type: 'boolean',
     value: false,
     description: 'Build libdvdnav examples')
+
+option('extra_checks',
+    type : 'boolean',
+    value : false,
+    description : 'Turn some warnings into compilation error')


=====================================
src/dvdnav.c
=====================================
@@ -28,6 +28,10 @@
 #define LOG_DEBUG
 */
 
+#include "dvdnav/dvdnav.h"
+#include <dvdread/dvd_reader.h>
+#include <dvdread/nav_types.h>
+
 #include <inttypes.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -35,9 +39,6 @@
 #include <limits.h>
 #include <string.h>
 #include <sys/time.h>
-#include "dvdnav/dvdnav.h"
-#include <dvdread/dvd_reader.h>
-#include <dvdread/nav_types.h>
 #include "vm/decoder.h"
 #include "vm/vm.h"
 #include "vm/getset.h"


=====================================
src/highlight.c
=====================================
@@ -22,6 +22,9 @@
 #include "config.h"
 #endif
 
+#include <dvdread/nav_types.h>
+#include "dvdnav/dvdnav.h"
+
 #include <assert.h>
 #include <inttypes.h>
 #include <stdlib.h>
@@ -29,8 +32,6 @@
 #include <limits.h>
 #include <string.h>
 #include <sys/time.h>
-#include <dvdread/nav_types.h>
-#include "dvdnav/dvdnav.h"
 #include "vm/decoder.h"
 #include "vm/vm.h"
 #include "vm/vmcmd.h"


=====================================
src/navigation.c
=====================================
@@ -22,12 +22,13 @@
 #include "config.h"
 #endif
 
+#include "dvdnav/dvdnav.h"
+#include <dvdread/nav_types.h>
+
 #include <inttypes.h>
 #include <limits.h>
 #include <string.h>
 #include <sys/time.h>
-#include "dvdnav/dvdnav.h"
-#include <dvdread/nav_types.h>
 #include "vm/decoder.h"
 #include "vm/vm.h"
 #include "dvdnav_internal.h"


=====================================
src/read_cache.c
=====================================
@@ -28,14 +28,15 @@
 #include "config.h"
 #endif
 
+#include "dvdnav/dvdnav.h"
+#include <dvdread/nav_types.h>
+
 #include <assert.h>
 #include <inttypes.h>
 #include <stdlib.h>
 #include <limits.h>
 #include <sys/time.h>
 #include <time.h>
-#include "dvdnav/dvdnav.h"
-#include <dvdread/nav_types.h>
 #include "vm/decoder.h"
 #include "vm/vm.h"
 #include "dvdnav_internal.h"


=====================================
src/searching.c
=====================================
@@ -22,6 +22,9 @@
 #include "config.h"
 #endif
 
+#include "dvdnav/dvdnav.h"
+#include <dvdread/nav_types.h>
+
 #include <assert.h>
 #include <inttypes.h>
 #include <limits.h>
@@ -29,8 +32,6 @@
 #include <string.h>
 #include <stdlib.h>
 #include <sys/time.h>
-#include "dvdnav/dvdnav.h"
-#include <dvdread/nav_types.h>
 #include "vm/decoder.h"
 #include "vm/vm.h"
 #include "dvdnav_internal.h"


=====================================
src/settings.c
=====================================
@@ -22,12 +22,13 @@
 #include "config.h"
 #endif
 
+#include "dvdnav/dvdnav.h"
+#include <dvdread/nav_types.h>
+
 #include <inttypes.h>
 #include <limits.h>
 #include <string.h>
 #include <sys/time.h>
-#include "dvdnav/dvdnav.h"
-#include <dvdread/nav_types.h>
 #include "vm/decoder.h"
 #include "vm/vm.h"
 #include "dvdnav_internal.h"


=====================================
src/vm/decoder.c
=====================================
@@ -24,6 +24,8 @@
 #include "config.h"
 #endif
 
+#include <dvdread/nav_types.h>
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <inttypes.h>
@@ -32,8 +34,6 @@
 #include <sys/time.h>
 #include <assert.h>
 
-#include <dvdread/nav_types.h>
-
 #include "dvdnav/dvdnav.h"
 #include "decoder.h"
 #include "vm.h"


=====================================
src/vm/getset.c
=====================================
@@ -25,15 +25,15 @@
 #include "config.h"
 #endif
 
+#include <dvdread/nav_types.h>
+#include <dvdread/ifo_read.h>
+#include "dvdnav/dvdnav.h"
+
 #include <assert.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <inttypes.h>
 
-#include <dvdread/nav_types.h>
-#include <dvdread/ifo_read.h>
-#include "dvdnav/dvdnav.h"
-
 #include "decoder.h"
 #include "vm.h"
 #include "getset.h"


=====================================
src/vm/play.c
=====================================
@@ -25,14 +25,14 @@
 #include "config.h"
 #endif
 
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-
 #include <dvdread/nav_types.h>
 #include <dvdread/ifo_read.h>
 #include "dvdnav/dvdnav.h"
 
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+
 #include "decoder.h"
 #include "vm.h"
 #include "play.h"


=====================================
src/vm/vm.c
=====================================
@@ -25,6 +25,10 @@
 #include "config.h"
 #endif
 
+#include <dvdread/nav_types.h>
+#include <dvdread/ifo_read.h>
+#include "dvdnav/dvdnav.h"
+
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -38,10 +42,6 @@
 #include <fcntl.h>
 #include <ctype.h>
 
-#include <dvdread/nav_types.h>
-#include <dvdread/ifo_read.h>
-#include "dvdnav/dvdnav.h"
-
 #include "decoder.h"
 #include "vm.h"
 #include "play.h"


=====================================
src/vm/vmcmd.c
=====================================
@@ -24,14 +24,15 @@
 #include "config.h"
 #endif
 
+#include "dvdnav/dvdnav.h"
+#include <dvdread/nav_types.h>
+
 #include <stdio.h>
 #include <ctype.h>
 #include <inttypes.h>
 #include <limits.h>
 #include <sys/time.h>
 
-#include "dvdnav/dvdnav.h"
-#include <dvdread/nav_types.h>
 #include "decoder.h"
 #include "vm.h"
 #include "vmcmd.h"


=====================================
src/vm/vmget.c
=====================================
@@ -25,16 +25,16 @@
 #include "config.h"
 #endif
 
+#include <dvdread/nav_types.h>
+#include <dvdread/ifo_read.h>
+#include "dvdnav/dvdnav.h"
+
 #include <assert.h>
 #include <inttypes.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
 
-#include <dvdread/nav_types.h>
-#include <dvdread/ifo_read.h>
-#include "dvdnav/dvdnav.h"
-
 #include "decoder.h"
 #include "vm.h"
 #include "getset.h"



View it on GitLab: https://code.videolan.org/videolan/libdvdnav/-/compare/9c5f2278eb5b23cdcd0575065f5d575c4e6602a4...e0c02b973c62081ee8dc109726e511e94c10f70e

-- 
View it on GitLab: https://code.videolan.org/videolan/libdvdnav/-/compare/9c5f2278eb5b23cdcd0575065f5d575c4e6602a4...e0c02b973c62081ee8dc109726e511e94c10f70e
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