File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -246,10 +246,6 @@ foreach arg : ['-Wundef',
246246 ' -Wendif-labels' ,
247247 ' -Wstrict-aliasing=2' ,
248248 ' -Wwrite-strings' ,
249- ' -Wno-unused-parameter' ,
250- ' -Wno-missing-field-initializers' ,
251- ' -Wno-unused-result' ,
252- ' -Wno-format-signedness' ,
253249 ' -Werror=overflow' ,
254250 ' -Wdate-time' ,
255251 ' -Wnested-externs' ,
@@ -268,6 +264,17 @@ foreach arg : ['-Wundef',
268264 endif
269265endforeach
270266
267+ # "negative" arguments: gcc on purpose does not return an error for "-Wno-"
268+ # arguments, just emits a warnings. So test for the "positive" version instead.
269+ foreach arg : [' unused-parameter' ,
270+ ' missing-field-initializers' ,
271+ ' unused-result' ,
272+ ' format-signedness' ]
273+ if cc.has_argument(' -W' + arg)
274+ add_project_arguments (' -Wno-' + arg, language : ' c' )
275+ endif
276+ endforeach
277+
271278if cc.compiles('
272279 #include <time.h>
273280 #include <inttypes.h>
You can’t perform that action at this time.
0 commit comments