mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-29 18:07:16 +02:00
build: compiler warnings handling refactored for clang
This commit is contained in:
@ -53,7 +53,7 @@ macro(_set_flags)
|
||||
/permissive- # standards conformance mode for MSVC compiler.
|
||||
)
|
||||
|
||||
set(CLANG_WARNINGS
|
||||
set(GCC_COMMON_WARNINGS
|
||||
-Wall
|
||||
-Wextra # reasonable and standard
|
||||
-Wpedantic # warn if non-standard C++ is used
|
||||
@ -67,17 +67,17 @@ macro(_set_flags)
|
||||
-Wconversion # warn on type conversions that may lose data
|
||||
-Wsign-conversion # warn on sign conversions
|
||||
-Wnull-dereference # warn if a null dereference is detected
|
||||
-Wdouble-promotion # warn if float is implicit promoted to double
|
||||
-Wformat=2 # warn on security issues around functions that format output (ie printf)
|
||||
)
|
||||
|
||||
set(CLANG_WARNINGS
|
||||
${GCC_COMMON_WARNINGS}
|
||||
-Wno-missing-braces
|
||||
)
|
||||
|
||||
set(GCC_WARNINGS
|
||||
${CLANG_WARNINGS}
|
||||
-Wno-float-conversion
|
||||
-Wno-shorten-64-to-32
|
||||
-Wno-implicit-float-conversion
|
||||
-Wno-implicit-int-float-conversion
|
||||
-Wno-implicit-int-conversion
|
||||
${GCC_COMMON_WARNINGS}
|
||||
-Wdouble-promotion # warn if float is implicit promoted to double
|
||||
-Wmisleading-indentation # warn if indentation implies blocks where blocks do not exist
|
||||
-Wduplicated-cond # warn if if / else chain has duplicated conditions
|
||||
-Wduplicated-branches # warn if if / else branches have duplicated code
|
||||
|
Reference in New Issue
Block a user