# Don't need any of this widechar stuff, so just disable it for now
printf_args += ['-UHAVE_WCHAR_T', '-UHAVE_WCSLEN', '-UHAVE_WINT_T']
+if cc.has_argument('-Wno-format-nonliteral')
+ printf_args += ['-Wno-format-nonliteral']
+endif
+
# Check if 'long long' works and what format can be used to print it
# jm_AC_TYPE_LONG_LONG
if cc.compiles('''long long ll = 1LL;
endif
endif
+no_warn_args = []
+foreach arg : [
+ '-Wno-undef',
+ '-Wno-redundant-decls',
+ '-Wno-missing-prototypes',
+ '-Wno-missing-declarations',
+ '-Wno-old-style-definition',
+ '-Wno-declaration-after-statement']
+ if cc.has_argument(arg)
+ no_warn_args += [arg]
+ endif
+endforeach
+
libcheck = static_library('check',
libcheck_files,
include_directories : [configinc, internal_check_h_inc],
dependencies : [rt_lib, mathlib],
- c_args: gst_c_args + libcheck_visibility_args +
+ c_args: gst_c_args + libcheck_visibility_args + no_warn_args +
# Don't want libcompat to think we don't have these and substitute
# replacements since we don't check for or define these. See libcompat.h
['-DHAVE_VSNPRINTF', '-DHAVE_SNPRINTF', '-DHAVE_MALLOC', '-DHAVE_REALLOC'],
elif cc.has_argument('-Wl,-Bsymbolic-functions')
# FIXME: Add an option for this if people ask for it
add_project_link_arguments('-Wl,-Bsymbolic-functions', language : 'c')
- # FIXME: Add FATAL_WARNINGS from configure.ac
endif
# Symbol visibility
add_project_arguments(['-Wno-unused'], language: 'c')
endif
+warning_flags = [
+ '-Wmissing-declarations',
+ '-Wmissing-prototypes',
+ '-Wredundant-decls',
+ '-Wundef',
+ '-Wwrite-strings',
+ '-Wformat-nonliteral',
+ '-Wformat-security',
+ '-Wold-style-definition',
+ '-Winit-self',
+ '-Wmissing-include-dirs',
+ '-Waddress',
+ '-Waggregate-return',
+ '-Wno-multichar',
+ '-Wnested-externs',
+ '-Wdeclaration-after-statement',
+ '-Wvla',
+ '-Wpointer-arith',
+]
+
+foreach extra_arg : warning_flags
+ if cc.has_argument (extra_arg)
+ add_project_arguments([extra_arg], language: 'c')
+ endif
+endforeach
+
# Used by the gstutils test
gmp_dep = cc.find_library('gmp', required : false)
cdata.set('HAVE_GMP', gmp_dep.found())