[vlc-commits] [Git][videolan/vlc][master] build: only check -Werror=return-mismatch when compiling for C

Steve Lhomme (@robUx4) gitlab at videolan.org
Sun Dec 1 15:06:18 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
cb73b3a3 by Steve Lhomme at 2024-12-01T14:53:02+00:00
build: only check -Werror=return-mismatch when compiling for C

LLVM(18) doesn't support this option in any language.
GCC warns that this is not supported in C++ but autotools and meson consider it's supported.

Fixes this warning:

> cc1plus: warning: '-Werror=' argument '-Werror=return-mismatch' is not valid for C++

- - - - -


2 changed files:

- configure.ac
- meson.build


Changes:

=====================================
configure.ac
=====================================
@@ -1194,7 +1194,7 @@ AC_ARG_ENABLE([extra_checks],
 AS_IF([test "${enable_extra_checks}" = "yes"], [
     AX_APPEND_COMPILE_FLAGS([-Werror=missing-field-initializers -Werror=format -Werror=incompatible-pointer-types -Werror=restrict -Werror=int-conversion -Werror=implicit-int -Werror=return-mismatch -Werror=declaration-missing-parameter-type], [CFLAGS])
     AC_LANG_PUSH(C++)
-    AX_APPEND_COMPILE_FLAGS([-Werror=missing-field-initializers -Werror=format -Werror=return-mismatch], [CXXFLAGS])
+    AX_APPEND_COMPILE_FLAGS([-Werror=missing-field-initializers -Werror=format], [CXXFLAGS])
     AC_LANG_POP(C++)
 ])
 


=====================================
meson.build
=====================================
@@ -528,7 +528,6 @@ if get_option('extra_checks')
     add_project_arguments(cpp.get_supported_arguments([
         '-Werror=missing-field-initializers',
         '-Werror=format',
-        '-Werror=return-mismatch'
     ]), language: ['cpp'])
 endif
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/cb73b3a347be78cd7a87fc47fbe064fbf26404fc

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/cb73b3a347be78cd7a87fc47fbe064fbf26404fc
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list