Lines Matching +full:unused +full:- +full:but +full:- +full:set +full:- +full:variable
2 # SPDX-License-Identifier: MIT
14 # Remove all warning flags, add -w to suppress built-in warnings.
25 # file - this is due to really weird and annoying legacy behavior of CMAKE_C_FLAGS.
28 # Restore the last set of flags that were saved with push_warnings(). Note that modifications…
35 set(_internal_enable_warnings_already_run TRUE)
42 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
50 # Ex.: remove_warnings(-Wall -Wdouble-promotion -Wcomment) prunes those warnings flags from the com…
53 set(langs C)
59 set(toadd)
60 set(in_explicit_disable FALSE)
63 set(in_explicit_disable TRUE)
72 set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}" PARENT_SCOPE)
81 set(langs C)
87 string(REGEX REPLACE "[-/][Ww][^ \t]*([ \t]+|$)" "" CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}")
91 string(APPEND CMAKE_${lang}_FLAGS " -w")
94 set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}" PARENT_SCOPE)
104 target_compile_options(${target} PRIVATE "-w")
110 # Save the current warning settings to an internal variable.
113 set(langs C)
126 …set(_enable_warnings_internal_${lang}_flags_stack "${_enable_warnings_internal_${lang}_flags_stack…
131 # Restore the current warning settings from an internal variable.
134 set(langs C)
144 list(GET _enable_warnings_internal_${lang}_flags_stack -1 CMAKE_${lang}_FLAGS)
145 list(REMOVE_AT _enable_warnings_internal_${lang}_flags_stack -1)
147 …set(_enable_warnings_internal_${lang}_flags_stack "${_enable_warnings_internal_${lang}_flags_stack…
149 set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}" PARENT_SCOPE)
154 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
164 set(${configs_var} "NONE")
176 set(config)
178 set(config "_${config}")
191 set(config)
193 set(config "_${config}")
205 set(config)
207 set(config "_${config}")
210 set(CMAKE_${lang}_FLAGS${config} "${CMAKE_${lang}_FLAGS${config}}" PARENT_SCOPE)
217 set(configs "NONE")
221 set(_flags_C)
222 set(_flags_CXX)
223 set(_debug_flags_C)
224 set(_debug_flags_CXX)
227 # Don't automatically set /W3
228 CMAKE_POLICY (SET CMP0092 NEW)
231 # "-W[name]" warnings will work.
233 set(_flags
239 …/w14265 # 'classname': class has virtual functions, but destructor is not virtual instances of thi…
242 …/we4289 # nonstandard extension used: 'variable': loop control variable declared in the for-loop i…
243 # the for-loop scope
245 /w14311 # 'variable': pointer truncation from 'type1' to 'type2'
248 /w14547 # 'operator': operator before comma has no effect; expected operator with side-effect
250 /w14555 # expression has no effect; expected expression with side- effect
252 /w14640 # Enable warning on thread un-safe static member initialization
253 …/w14826 # Conversion from 'type1' to 'type2' is sign-extended. This may cause unexpected runtime b…
256 …/w14928 # illegal copy-initialization; more than one user-defined conversion has been implicitly a…
263 … as an error. https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warni…
271 set(_flags
273 -w3
275 …-wd383 # Spammy warning about initializing from a temporary object in C++ (which is done all th…
276 -wd11074 # Diagnostic related to inlining.
277 -wd11076 # Diagnostic related to inlining.
284 set (_flags
285 -qwarn64
286 -qformat=all
287 -qflag=i:i
296 -Wall
297 -Wextra
300 -Waggregate-return
301 -Wcast-align
302 -Wcast-qual
303 -Wconversion
304 -Wdeclaration-after-statement
305 -Wdouble-promotion
306 -Wfloat-equal
307 -Wformat-security
308 -Winit-self
309 -Wjump-misses-init
310 -Wlogical-op
311 -Wmissing-braces
312 -Wmissing-declarations
313 -Wmissing-format-attribute
314 -Wmissing-include-dirs
315 -Wmissing-prototypes
316 -Wnested-externs
317 -Wno-coverage-mismatch
318 -Wold-style-definition
319 -Wpacked
320 -Wpedantic
321 -Wpointer-arith
322 -Wredundant-decls
323 -Wshadow
324 -Wsign-conversion
325 -Wstrict-overflow
326 -Wstrict-prototypes
327 -Wtrampolines
328 -Wundef
329 -Wunreachable-code
330 -Wunused
331 -Wvariadic-macros
332 -Wvla
333 -Wwrite-strings
335 # On Windows MinGW I think implicit fallthrough enabled by -Wextra must not default to 3
336 -Wimplicit-fallthrough=3
338 # Treat implicit variable typing and implicit function declarations as errors.
339 -Werror=implicit-int
340 -Werror=implicit-function-declaration
342 # Make MacOSX honor -mmacosx-version-min
343 -Werror=partial-availability
345 # Some clang versions might warn if an argument like "-I/path/to/headers" is unused,
347 -Qunused-arguments
349 -Wno-long-long
354 -Wall
355 -Wextra
358 -Wcast-align
359 -Wformat-security
360 -Wmissing-declarations
361 -Wmissing-format-attribute
362 -Wpacked-bitfield-compat
363 -Wredundant-decls
364 -Wvla
366 # Turn off unused parameter warnings with C++ (they happen often in C++ and Qt).
367 -Wno-unused-parameter
369 # Some clang versions might warn if an argument like "-I/path/to/headers" is unused,
371 -Qunused-arguments
374 # Note: when cross-compiling to Windows from Cygwin, the Qt Mingw packages have a bunch of
375 # noisy type-conversion warnings in headers. So, only enable those warnings if we're
379 -Wconversion
380 -Wfloat-equal
381 -Wsign-conversion
387 set(color_default TRUE)
389 set(color_default FALSE)
394 set(_flags
395 -fdiagnostics-color=always # GCC
396 -fcolor-diagnostics # Clang
402 # Add -fno-omit-frame-pointer (and optionally -fno-inline) to make debugging and stack dumps nicer.
403 set(_flags
404 -fno-omit-frame-pointer
409 -fno-inline
416 # Check and set compiler flags.
417 set(_debug_configs
429 set(_config Debug)
430 _int_enable_warnings_set_flags_ex(_lang _config -O0)