Enable conversion warning checking for pedantic build

This commit is contained in:
Florin Iucha 2018-12-15 23:46:36 -05:00
parent 48ef90edac
commit 1d2d479afa
2 changed files with 4 additions and 3 deletions

View File

@ -74,8 +74,9 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
-Wcast-align -Wnon-virtual-dtor
-Wctor-dtor-privacy -Wdisabled-optimization
-Winvalid-pch -Woverloaded-virtual
-Wconversion
-Wno-ctor-dtor-privacy -Wno-dangling-else
-Wno-format-nonliteral -Wno-sign-conversion -Wno-shadow -Wno-unused-local-typedefs)
-Wno-format-nonliteral -Wno-shadow -Wno-unused-local-typedefs)
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6)
set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS} -Wnoexcept)
endif ()
@ -92,7 +93,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
endif ()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(PEDANTIC_COMPILE_FLAGS -Wall -Wextra -pedantic)
set(PEDANTIC_COMPILE_FLAGS -Wall -Wextra -pedantic -Wconversion -Wno-sign-conversion)
check_cxx_compiler_flag(-Wzero-as-null-pointer-constant HAS_NULLPTR_WARNING)
if (HAS_NULLPTR_WARNING)
set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS}

View File

@ -631,7 +631,7 @@ void basic_printf_context<OutputIt, Char, AF>::format() {
format_arg arg = get_arg(it, arg_index);
if (spec.has(HASH_FLAG) && visit_format_arg(internal::is_zero_int(), arg))
spec.flags &= ~internal::to_unsigned<int>(HASH_FLAG);
spec.flags = static_cast<uint_least8_t>(spec.flags & (~internal::to_unsigned<int>(HASH_FLAG)));
if (spec.fill_ == '0') {
if (arg.is_arithmetic())
spec.align_ = ALIGN_NUMERIC;