testAtomicStringNumber may not be null-terminated. Caught by -Wstringop-truncation: ../../Tools/TestWebKitAPI/Tests/WTF/AtomicString.cpp:67:17: warning: ‘char* strncpy(char*, const char*, size_t)’ specified bound 100 equals destination size [-Wstringop-truncation]
Also, related: [415/2047] Building CXX object Tools/TestWebKitAPI/CMakeFiles/TestWTF.dir/Tests/WTF/WTFString.cpp.o ../../Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp: In function ‘const char* TestWebKitAPI::testStringNumber(double)’: ../../Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp:169:17: warning: ‘char* strncpy(char*, const char*, size_t)’ specified bound 100 equals destination size [-Wstringop-truncation] std::strncpy(testBuffer, String::numberToStringECMAScript(number).utf8().data(), 100); ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp:169:17: warning: ‘char* strncpy(char*, const char*, size_t)’ specified bound 100 equals destination size [-Wstringop-truncation] ../../Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp: In function ‘const char* TestWebKitAPI::testStringNumberFixedWidth(double)’: ../../Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp:120:17: warning: ‘char* strncpy(char*, const char*, size_t)’ specified bound 100 equals destination size [-Wstringop-truncation] std::strncpy(testBuffer, String::numberToStringFixedWidth(number, 6).utf8().data(), 100); ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp:120:17: warning: ‘char* strncpy(char*, const char*, size_t)’ specified bound 100 equals destination size [-Wstringop-truncation] ../../Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp: In function ‘const char* TestWebKitAPI::testStringNumberFixedPrecision(double)’: ../../Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp:71:17: warning: ‘char* strncpy(char*, const char*, size_t)’ specified bound 100 equals destination size [-Wstringop-truncation] std::strncpy(testBuffer, String::number(number).utf8().data(), 100); ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Created attachment 340064 [details] Patch
Comment on attachment 340064 [details] Patch Clearing flags on attachment: 340064 Committed r231661: <https://trac.webkit.org/changeset/231661>
All reviewed patches have been landed. Closing bug.
<rdar://problem/40142604>
Thanks for fixing this. For the record, changing the 100 to 99 was necessary, but adding the "= { }" was not since these are globals and initialized to zero in any case.
(In reply to Darin Adler from comment #6) > Thanks for fixing this. For the record, changing the 100 to 99 was > necessary, but adding the "= { }" was not since these are globals and > initialized to zero in any case. Good point, you're right! I overlooked the static keyword.