Opened 8 years ago
Closed 4 years ago
#3753 closed defect (fixed)
TestCppformat runtime check failures in Windows debug build — at Version 6
Reported by: | historic_bruno | Owned by: | |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 24 |
Component: | Core engine | Keywords: | |
Cc: | Patch: |
Description (last modified by )
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 (7)
by , 8 years ago
Attachment: | format.cpp.patch added |
---|
comment:1 by , 8 years ago
comment:2 by , 8 years ago
Keywords: | review removed |
---|---|
Milestone: | Alpha 20 → Alpha 21 |
It would probably better to take a look at #3190 before. Maybe recent changes fix this behavior.
comment:3 by , 8 years ago
Unfortunately, the errors still occur with the patches on #3190. This patch applies cleanly and still silences the error.
comment:6 by , 4 years ago
Description: | modified (diff) |
---|---|
Keywords: | patch removed |
Milestone: | Backlog → Alpha 24 |
Resolution: | → fixed |
Status: | new → closed |
Summary: | [PATCH] TestCppformat runtime check failures in Windows debug build → TestCppformat runtime check failures in Windows debug build |
The patch looks good to me, and and don't think it's possible to change that cast to something else either.