Closed syby119 closed 2 months ago
In efsw/src/efsw/Log.cpp line 45
efDEBUG( "%s\n", LastError.c_str() );
Compiler MSVC complains that warning C4834: discarding return value of function with [[nodiscard]] attribute.
This is because when the compiler is MSVC, the macro efDEBUG is empty. This leads to the macro expansion to
("%s\n", LastError.c_str());
And the declaration of std::string::c_str() is marked as [[no discard]] in MSVC
_NODISCARD _CONSTEXPR20 _Ret_z_ const _Elem* c_str() const noexcept { return _Mypair._Myval2._Myptr(); }
There are multiple solutions to fix this warning, one choice is change the macro efDEBUG to
#define efDEBUG(...) {}
In efsw/src/efsw/Log.cpp line 45
Compiler MSVC complains that warning C4834: discarding return value of function with [[nodiscard]] attribute.
This is because when the compiler is MSVC, the macro efDEBUG is empty. This leads to the macro expansion to
And the declaration of std::string::c_str() is marked as [[no discard]] in MSVC
There are multiple solutions to fix this warning, one choice is change the macro efDEBUG to