gulrak / filesystem

An implementation of C++17 std::filesystem for C++11 /C++14/C++17/C++20 on Windows, macOS, Linux and FreeBSD.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compiler warnings

ruipacheco opened this issue · comments

Is your feature request related to a problem? Please describe.
Not a problem, just some compiler warnings I got in the latest macOS with the latest Xcode.

Describe the solution you'd like
Comment and possibly act on these:

filesystem.hpp:3561:44: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
if (::getcwd(buffer.get(), pathlen) == NULL) {
^~~~
nullptr

filesystem.hpp:2559:12: note: call 'std::move' explicitly to avoid copying on older compilers
return fn;
^~
std::move(fn)

filesystem.hpp:2559:12: warning: prior to the resolution of a defect report against ISO C++11, local variable 'fn' would have been copied despite being returned by name, due to its not matching the function return type ('ghc::filesystem::path' vs 'ghc::filesystem::path::impl_string_type' (aka 'basic_string')) [-Wreturn-std-move-in-c++11]
return fn;
^~

I didn't switch to the latest Xcode yet, but of course I want to stay warning free where possible, so I'll sure look into it. Thank you for reporting this!

Released with v1.3.0.