Remove all usage of vsnprintf (dotnet/coreclr#8709)
authorJan Vorlicek <janvorli@microsoft.com>
Fri, 23 Dec 2016 13:41:28 +0000 (14:41 +0100)
committerJan Kotas <jkotas@microsoft.com>
Fri, 23 Dec 2016 13:41:28 +0000 (05:41 -0800)
commit7ec778b10221f61923f7522155d4be8a5865ebe3
treebb46f7301598ed8a4ff73ad9404f7252ff5109fc
parent88a2ab9b5eeb1c6375f98c5630bf8b29fef65635
Remove all usage of vsnprintf (dotnet/coreclr#8709)

This change removes all usages of vsnprintf and modifies runtime to not to use
vsnprintf or _vsnprintf

I've also fixed two issues in PAL TRACE function string format parameters that
caused crashes when I was trying to run all PAL tests with PAL tracing enabled.

Commit migrated from https://github.com/dotnet/coreclr/commit/f5cbe4c9cab2873b60cd3c991732a250d2e164a2
105 files changed:
src/coreclr/src/ToolBox/SOS/Strike/strike.h
src/coreclr/src/ToolBox/SOS/Strike/xplat/dbgeng.h
src/coreclr/src/dlls/mscordac/mscordac_unixexports.src
src/coreclr/src/gc/env/gcenv.base.h
src/coreclr/src/gc/gc.cpp
src/coreclr/src/md/compiler/regmeta.cpp
src/coreclr/src/pal/inc/pal.h
src/coreclr/src/pal/inc/rt/palrt.h
src/coreclr/src/pal/inc/rt/safecrt.h
src/coreclr/src/pal/src/cruntime/printf.cpp
src/coreclr/src/pal/src/cruntime/printfcpp.cpp
src/coreclr/src/pal/src/cruntime/silent_printf.cpp
src/coreclr/src/pal/src/cruntime/string.cpp
src/coreclr/src/pal/src/include/pal/palinternal.h
src/coreclr/src/pal/src/include/pal/printfcpp.hpp
src/coreclr/src/pal/src/misc/dbgmsg.cpp
src/coreclr/src/pal/src/misc/fmtmessage.cpp
src/coreclr/src/pal/tests/palsuite/c_runtime/CMakeLists.txt
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test5/CMakeLists.txt [deleted file]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test5/test5.cpp [deleted file]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test5/testinfo.dat [deleted file]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/CMakeLists.txt [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/CMakeLists.txt with 95% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/_vsnprintf_s.h [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/_vsnprintf.h with 97% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test1/CMakeLists.txt [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test1/CMakeLists.txt with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test1/test1.cpp [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test1/test1.cpp with 93% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test1/testinfo.dat [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test1/testinfo.dat with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test10/CMakeLists.txt [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test10/CMakeLists.txt with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test10/test10.cpp [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test10/test10.cpp with 97% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test10/testinfo.dat [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test10/testinfo.dat with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test11/CMakeLists.txt [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test11/CMakeLists.txt with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test11/test11.cpp [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test11/test11.cpp with 97% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test11/testinfo.dat [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test11/testinfo.dat with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test12/CMakeLists.txt [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test12/CMakeLists.txt with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test12/test12.cpp [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test12/test12.cpp with 98% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test12/testinfo.dat [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test12/testinfo.dat with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test13/CMakeLists.txt [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test13/CMakeLists.txt with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test13/test13.cpp [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test13/test13.cpp with 98% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test13/testinfo.dat [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test13/testinfo.dat with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test14/CMakeLists.txt [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test14/CMakeLists.txt with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test14/test14.cpp [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test14/test14.cpp with 98% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test14/testinfo.dat [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test14/testinfo.dat with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test15/CMakeLists.txt [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test15/CMakeLists.txt with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test15/test15.cpp [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test15/test15.cpp with 98% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test15/testinfo.dat [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test15/testinfo.dat with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test16/CMakeLists.txt [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test16/CMakeLists.txt with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test16/test16.cpp [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test16/test16.cpp with 98% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test16/testinfo.dat [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test16/testinfo.dat with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test17/CMakeLists.txt [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test17/CMakeLists.txt with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test17/test17.cpp [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test17/test17.cpp with 98% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test17/testinfo.dat [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test17/testinfo.dat with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test18/CMakeLists.txt [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test18/CMakeLists.txt with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test18/test18.cpp [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test18/test18.cpp with 98% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test18/testinfo.dat [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test18/testinfo.dat with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test19/CMakeLists.txt [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/CMakeLists.txt with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test19/test19.cpp [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/test19.cpp with 99% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test19/testinfo.dat [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/testinfo.dat with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test2/CMakeLists.txt [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test2/CMakeLists.txt with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test2/test2.cpp [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test2/test2.cpp with 97% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test2/testinfo.dat [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test2/testinfo.dat with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test3/CMakeLists.txt [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test3/CMakeLists.txt with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test3/test3.cpp [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test3/test3.cpp with 97% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test3/testinfo.dat [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test3/testinfo.dat with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test4/CMakeLists.txt [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test4/CMakeLists.txt with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test4/test4.cpp [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test4/test4.cpp with 99% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test4/testinfo.dat [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test4/testinfo.dat with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test6/CMakeLists.txt [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test6/CMakeLists.txt with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test6/test6.cpp [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test6/test6.cpp with 97% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test6/testinfo.dat [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test6/testinfo.dat with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test7/CMakeLists.txt [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test7/CMakeLists.txt with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test7/test7.cpp [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test7/test7.cpp with 97% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test7/testinfo.dat [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test7/testinfo.dat with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test8/CMakeLists.txt [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test8/CMakeLists.txt with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test8/test8.cpp [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test8/test8.cpp with 97% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test8/testinfo.dat [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test8/testinfo.dat with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test9/CMakeLists.txt [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test9/CMakeLists.txt with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test9/test9.cpp [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test9/test9.cpp with 97% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test9/testinfo.dat [moved from src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf/test9/testinfo.dat with 100% similarity]
src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/CMakeLists.txt
src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/swprintf.h
src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test1/test1.cpp
src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test19/test19.cpp
src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test5/CMakeLists.txt [deleted file]
src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test5/test5.cpp [deleted file]
src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test5/testinfo.dat [deleted file]
src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/CMakeLists.txt
src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test1/test1.cpp
src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test5/CMakeLists.txt [deleted file]
src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test5/test5.cpp [deleted file]
src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test5/testinfo.dat [deleted file]
src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/vsprintf.h
src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/CMakeLists.txt
src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test1/test1.cpp
src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test19/test19.cpp
src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test4/test4.cpp
src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test5/CMakeLists.txt [deleted file]
src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test5/test5.cpp [deleted file]
src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test5/testinfo.dat [deleted file]
src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/vswprintf.h
src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test1/GetTempFileNameW.cpp
src/coreclr/src/pal/tests/palsuite/paltestlist.txt
src/coreclr/src/pal/tests/palsuite/palverify.dat
src/coreclr/src/palrt/coguid.cpp
src/coreclr/src/utilcode/log.cpp
src/coreclr/src/utilcode/sstring.cpp
src/coreclr/src/vm/multicorejit.cpp