From 0bf4ef711e73ecc168ebd3d9526b23410a88d99d Mon Sep 17 00:00:00 2001 From: "FeRD (Frank Dana)" Date: Sun, 15 Jan 2023 12:43:20 -0500 Subject: [PATCH] FindFilesystem: Eliminate Win32 warning Using `printf("%s")` with a `std::filesystem::path` on Win32 will cause a compile warning, because `std::filesystem::path::value_type` is technically `wchar_t`. The warning is harmless, but by using iostream to print the value on `std::cout` instead, the code compiles without warnings. --- data/cmake/FindFilesystem.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/cmake/FindFilesystem.cmake b/data/cmake/FindFilesystem.cmake index fdfb780..e925a9f 100644 --- a/data/cmake/FindFilesystem.cmake +++ b/data/cmake/FindFilesystem.cmake @@ -197,12 +197,12 @@ set(_found FALSE) if(CXX_FILESYSTEM_HAVE_FS) # We have some filesystem library available. Do link checks string(CONFIGURE [[ - #include + #include #include <@CXX_FILESYSTEM_HEADER@> int main() { auto cwd = @CXX_FILESYSTEM_NAMESPACE@::current_path(); - printf("%s", cwd.c_str()); + std::cout << cwd << std::endl; return EXIT_SUCCESS; } ]] code @ONLY)