bad: Add extra warning flags

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8229>
This commit is contained in:
Edward Hervey 2025-01-06 09:12:19 +01:00 committed by GStreamer Marge Bot
parent 57196d634e
commit eef680b441
10 changed files with 29 additions and 12 deletions

View file

@ -9,7 +9,9 @@ dssim_dep = dependency('dssim', required: iqa_opt,
if dssim_dep.found()
gstiqa = library('gstiqa',
'iqa.c',
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API', '-DHAVE_DSSIM'],
c_args : gst_plugins_bad_args
+ ['-DGST_USE_UNSTABLE_API', '-DHAVE_DSSIM']
+ cc.get_supported_arguments('-Wno-aggregate-return'),
include_directories : [configinc],
dependencies : [gstvideo_dep, gstbase_dep, gst_dep, dssim_dep],
install : true,

View file

@ -31,6 +31,7 @@ else
'-Wno-missing-declarations',
'-Wno-old-style-definition',
'-Wno-redundant-decls',
'-Wno-maybe-uninitialized'
])
endif

View file

@ -43,6 +43,9 @@ elif host_system == 'android'
soundtouch_cargs += cxx.get_supported_arguments('-fexceptions')
endif
# Soundtouch headers have plenty of undefined macros
soundtouch_cargs += cxx.get_supported_arguments('-Wno-undef')
if soundtouch_dep.found()
gstsoundtouch = library('gstsoundtouch',
soundtouch_sources,

View file

@ -12,7 +12,7 @@ if libxml_dep.found() and pango_dep.found() and cairo_dep.found() and pangocairo
'gstttmlrender.c',
'gstttmlelement.c',
'gstttmlplugin.c'],
c_args : gst_plugins_bad_args,
c_args : gst_plugins_bad_args + cc.get_supported_arguments(['-Wno-aggregate-return']),
include_directories : [configinc],
dependencies : [gstvideo_dep, libxml_dep, pango_dep, cairo_dep, pangocairo_dep, libm],
install : true,

View file

@ -372,9 +372,12 @@ vulkan_enumtypes_c = custom_target('gstvulkanenum_c',
command : [mkenums, glib_mkenums, '@OUTPUT@', '@INPUT@'])
gen_sources += [vulkan_enumtypes_h]
# Disable warnings of dependencies
vulkan_args = cc.get_supported_arguments(['-Wno-aggregate-return'])
gstvulkan = library('gstvulkan-' + api_version,
vulkan_sources, vulkan_priv_sources, vulkan_wayland_sources, vulkan_xcb_sources, vulkan_enumtypes_c, vulkan_enumtypes_h,
c_args : gst_plugins_bad_args + vulkan_defines + ['-DBUILDING_GST_VULKAN', '-DG_LOG_DOMAIN="GStreamer-Vulkan"'],
c_args : gst_plugins_bad_args + vulkan_defines + vulkan_args + ['-DBUILDING_GST_VULKAN', '-DG_LOG_DOMAIN="GStreamer-Vulkan"'],
objc_args : gst_plugins_bad_args + vulkan_defines + vulkan_objc_args + ['-DBUILDING_GST_VULKAN', '-DG_LOG_DOMAIN="GStreamer-Vulkan"'],
include_directories : [configinc, libsinc],
version : libversion,

View file

@ -14,9 +14,7 @@ libimagequant_sources = [
]
local_c_args = ['-DLIQ_PRIVATE='] # GStreamer already has the right hidden symbol visibility
if cc.has_argument ('-Wno-unknown-pragmas')
local_c_args += ['-Wno-unknown-pragmas']
endif
local_c_args += cc.get_supported_arguments(['-Wno-unknown-pragmas', '-Wno-aggregate-return'])
gstdvbsubenc = library('gstdvbsubenc',
subenc_sources + libimagequant_sources,

View file

@ -220,23 +220,30 @@ cdata.set_quoted('GST_LICENSE', 'LGPL')
cdata.set_quoted('LIBDIR', join_paths(get_option('prefix'), get_option('libdir')))
cdata.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
# NOTE: Keep entries alphabetically sorted
warning_flags = [
'-Wmissing-declarations',
'-Wredundant-decls',
'-Wwrite-strings',
'-Waddress',
'-Wformat',
'-Wformat-security',
'-Wimplicit-fallthrough=3',
'-Winit-self',
'-Wmissing-declarations',
'-Wmissing-include-dirs',
'-Waddress',
'-Wmissing-parameter-type',
'-Wno-multichar',
'-Wvla',
'-Wpointer-arith',
'-Wredundant-decls',
'-Wshift-negative-value',
'-Wtype-limits',
'-Wundef',
'-Wvla',
'-Wwrite-strings',
]
warning_c_flags = [
'-Wmissing-prototypes',
'-Wold-style-definition',
'-Waggregate-return',
]
warning_cxx_flags = [

View file

@ -9,6 +9,7 @@ libcaption_sources = [
libcaption_static = static_library('libcaption-static',
libcaption_sources,
c_args : cc.get_supported_arguments(['-Wno-missing-prototypes']),
include_directories : include_directories('.'),
override_options: ['werror=false'],
)

View file

@ -69,6 +69,7 @@ else
# clang complains
'-Wno-missing-braces',
'-Wno-format-nonliteral',
'-Wno-undef'
])
endif

View file

@ -217,7 +217,8 @@ else
endif
gst_plugin_scanner_path = join_paths(gst_plugin_scanner_dir, 'gst-plugin-scanner')
extra_args = []
extra_args = cc.get_supported_arguments(['-Wno-aggregate-return'])
# XXX: our MinGW 32bits toolchain complians when ComPtr is in use
if host_system == 'windows' and cc.get_id() != 'msvc'
mingw_args = cc.get_supported_arguments([