Opened 8 years ago

Last modified 4 years ago

#3753 closed defect

[PATCH] TestCppformat runtime check failures in Windows debug build — at Initial Version

Reported by: historic_bruno Owned by:
Priority: Nice to Have Milestone: Alpha 24
Component: Core engine Keywords:
Cc: Patch:

Description

Some tests in TestCppformat trigger runtime check failures in Windows debug build:

Run-Time Check Failure #1 - A cast to a smaller data type has caused a loss of data. If this was intentional, you should mask the source of the cast with the appropriate bitmask. For example:

char c = (i & 0xFF);

Changing the code in this way will not affect the quality of the resulting optimized code.

I'm not sure that the code can be modified to comply with that check, so instead I've attached a patch for cppformat to disable it.

Call stack:

>	test_dbg.exe!`anonymous namespace'::ArgConverter<int>::visit_any_int<unsigned __int64>(unsigned __int64 value) Line 260	C++
 	test_dbg.exe!fmt::internal::ArgVisitor<`anonymous namespace'::ArgConverter<int>,void>::visit_ulong_long(unsigned __int64 value) Line 760	C++
 	test_dbg.exe!fmt::internal::ArgVisitor<`anonymous namespace'::ArgConverter<int>,void>::visit(const fmt::internal::Arg & arg) Line 805	C++
 	test_dbg.exe!fmt::internal::PrintfFormatter<char>::format(fmt::BasicWriter<char> & writer, fmt::BasicStringRef<char> format, const fmt::ArgList & args) Line 991	C++
 	test_dbg.exe!fmt::printf<char>(fmt::BasicWriter<char> & w, fmt::BasicStringRef<char> format, const fmt::ArgList & args) Line 1816	C++
 	test_dbg.exe!fmt::sprintf(fmt::BasicStringRef<char> format, const fmt::ArgList & args) Line 1829	C++
 	test_dbg.exe!fmt::sprintf<unsigned __int64>(fmt::BasicStringRef<char> arg0, const unsigned __int64 & v0) Line 2067	C++
 	test_dbg.exe!TestCppformat::test_basic() Line 39	C++
 	test_dbg.exe!TestDescription_suite_TestCppformat_test_basic::runTest() Line 27	C++
 	test_dbg.exe!CxxTest::RealTestDescription::run() Line 121	C++
 	test_dbg.exe!CxxTest::TestRunner::runTest(CxxTest::TestDescription & td) Line 105	C++
 	test_dbg.exe!CxxTest::TestRunner::runSuite(CxxTest::SuiteDescription & sd) Line 91	C++
 	test_dbg.exe!CxxTest::TestRunner::runWorld() Line 71	C++
 	test_dbg.exe!CxxTest::TestRunner::runAllTests(CxxTest::TestListener & listener) Line 42	C++
 	test_dbg.exe!CxxTest::ErrorFormatter::run() Line 63	C++
 	test_dbg.exe!CxxTest::Main<CxxTest::ErrorPrinter>(CxxTest::ErrorPrinter & tmp, int argc, char * * argv) Line 148	C++
 	test_dbg.exe!SDL_main(int argc, char * * argv) Line 21	C++
 	test_dbg.exe!main_utf8(int argc, char * * argv) Line 126	C
 	test_dbg.exe!main(int argc, char * * argv) Line 134	C
 	test_dbg.exe!__tmainCRTStartup() Line 626	C
 	test_dbg.exe!mainCRTStartup() Line 466	C

Change History (1)

by historic_bruno, 8 years ago

Attachment: format.cpp.patch added
Note: See TracTickets for help on using tickets.