Commit 02d579d7 authored by Dorota Czaplejewicz's avatar Dorota Czaplejewicz
Browse files

build: Enable unused warnings in C

The goal is to be free of unused X class of problems. For this, CI and any "serious" builds will fail on warnings. Debug builds, used in development, will warn by default but not fail.

In addition, the 'strict' build option is added for when the debug build should fail on unused warnings as well.
parent 6c5df029
...@@ -26,7 +26,7 @@ add_project_arguments( ...@@ -26,7 +26,7 @@ add_project_arguments(
'-Wold-style-definition', '-Wold-style-definition',
'-Wredundant-decls', '-Wredundant-decls',
'-Wstrict-prototypes', '-Wstrict-prototypes',
'-Wunused-function', '-Wunused',
], ],
language: 'c' language: 'c'
) )
...@@ -38,6 +38,16 @@ conf_data = configuration_data() ...@@ -38,6 +38,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')
language: 'c'
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', ...@@ -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')
type: 'boolean', value: true,
description: 'Turn more warnings into errors')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment