Merge branch 'unused' into 'master'
build: Enable unused warnings in C See merge request Librem5/squeekboard!375
This commit is contained in:
13
meson.build
13
meson.build
@ -23,12 +23,13 @@ add_project_arguments(
|
|||||||
'-Werror=parentheses',
|
'-Werror=parentheses',
|
||||||
'-Wformat-nonliteral',
|
'-Wformat-nonliteral',
|
||||||
'-Wformat-security',
|
'-Wformat-security',
|
||||||
|
'-Wformat',
|
||||||
'-Winit-self',
|
'-Winit-self',
|
||||||
'-Wmaybe-uninitialized',
|
'-Wmaybe-uninitialized',
|
||||||
'-Wold-style-definition',
|
'-Wold-style-definition',
|
||||||
'-Wredundant-decls',
|
'-Wredundant-decls',
|
||||||
'-Wstrict-prototypes',
|
'-Wstrict-prototypes',
|
||||||
'-Wunused-function',
|
'-Wunused',
|
||||||
],
|
],
|
||||||
language: 'c'
|
language: 'c'
|
||||||
)
|
)
|
||||||
@ -40,6 +41,16 @@ conf_data = configuration_data()
|
|||||||
if get_option('buildtype').startswith('debug')
|
if get_option('buildtype').startswith('debug')
|
||||||
add_project_arguments('-DDEBUG=1', language : 'c')
|
add_project_arguments('-DDEBUG=1', language : 'c')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if get_option('strict')
|
||||||
|
add_project_arguments(
|
||||||
|
[
|
||||||
|
'-Werror',
|
||||||
|
],
|
||||||
|
language: 'c'
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
||||||
if get_option('buildtype') != 'plain'
|
if get_option('buildtype') != 'plain'
|
||||||
add_project_arguments('-fstack-protector-strong', language: 'c')
|
add_project_arguments('-fstack-protector-strong', language: 'c')
|
||||||
endif
|
endif
|
||||||
|
|||||||
@ -10,3 +10,7 @@ option('tests',
|
|||||||
option('legacy',
|
option('legacy',
|
||||||
type: 'boolean', value: false,
|
type: 'boolean', value: false,
|
||||||
description: 'Build with Deban Buster versions of dependencies')
|
description: 'Build with Deban Buster versions of dependencies')
|
||||||
|
|
||||||
|
option('strict',
|
||||||
|
type: 'boolean', value: true,
|
||||||
|
description: 'Turn more warnings into errors')
|
||||||
|
|||||||
Reference in New Issue
Block a user