Thanks.
Tried both:

...(pthread_self(), "%s", const_cast<char*>(name_.c_str()));

...(pthread_self(), "%s", __UNCONST(name_.c_str()));


This time the build succeeded with this warning only:


...
[ 51%] Building CXX object 
src/cpp-utils/CMakeFiles/cpp-utils.dir/thread/debugging_nonwindows.cpp.o
/home/username/Projects/cryfs-1.0.1/src/cpp-utils/thread/debugging_nonwindows.cpp:
 In destructor ���cpputils::{anonymous}::OpenFileRAII::~OpenFileRAII()���:
/home/username/Projects/cryfs-1.0.1/src/cpp-utils/thread/debugging_nonwindows.cpp:50:13:
 warning: ���throw��� will always call ���terminate��� [-Wterminate]
   50 |             throw std::runtime_error("Error closing file. Errno: " + 
std::to_string(errno));
      |             
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/username/Projects/cryfs-1.0.1/src/cpp-utils/thread/debugging_nonwindows.cpp:50:13:
 note: in C++11 destructors default to ���noexcept���
[ 51%] Linking CXX static library libcpp-utils.a
...


It shows with my original changes as well, so at least -Wold-style-cast
warning isn't showing anymore.

Out of curiosity I tried binary from both changes to see if it solves
the 'could not open "/var/run/perfused%s.trace": Permission denied'
error. It doesn't.

Reply via email to