mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-30 02:17: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.
|
/permissive- # standards conformance mode for MSVC compiler.
|
||||||
)
|
)
|
||||||
|
|
||||||
set(CLANG_WARNINGS
|
set(GCC_COMMON_WARNINGS
|
||||||
-Wall
|
-Wall
|
||||||
-Wextra # reasonable and standard
|
-Wextra # reasonable and standard
|
||||||
-Wpedantic # warn if non-standard C++ is used
|
-Wpedantic # warn if non-standard C++ is used
|
||||||
@ -67,17 +67,17 @@ macro(_set_flags)
|
|||||||
-Wconversion # warn on type conversions that may lose data
|
-Wconversion # warn on type conversions that may lose data
|
||||||
-Wsign-conversion # warn on sign conversions
|
-Wsign-conversion # warn on sign conversions
|
||||||
-Wnull-dereference # warn if a null dereference is detected
|
-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)
|
-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
|
set(GCC_WARNINGS
|
||||||
${CLANG_WARNINGS}
|
${GCC_COMMON_WARNINGS}
|
||||||
-Wno-float-conversion
|
-Wdouble-promotion # warn if float is implicit promoted to double
|
||||||
-Wno-shorten-64-to-32
|
|
||||||
-Wno-implicit-float-conversion
|
|
||||||
-Wno-implicit-int-float-conversion
|
|
||||||
-Wno-implicit-int-conversion
|
|
||||||
-Wmisleading-indentation # warn if indentation implies blocks where blocks do not exist
|
-Wmisleading-indentation # warn if indentation implies blocks where blocks do not exist
|
||||||
-Wduplicated-cond # warn if if / else chain has duplicated conditions
|
-Wduplicated-cond # warn if if / else chain has duplicated conditions
|
||||||
-Wduplicated-branches # warn if if / else branches have duplicated code
|
-Wduplicated-branches # warn if if / else branches have duplicated code
|
||||||
|
Reference in New Issue
Block a user