-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
serverContext.cpp uses std::shared_ptr::unique() here
pvAccessCPP/src/server/serverContext.cpp
Line 301 in 1492b3d
| #define LEAK_CHECK(PTR, NAME) if((PTR) && !(PTR).unique()) { std::cerr<<"Leaking ServerContext " NAME " use_count="<<(PTR).use_count()<<"\n"<<show_referrers(PTR, false);} |
and here
pvAccessCPP/src/server/serverContext.cpp
Line 571 in 1492b3d
| if(!wrapped.unique()) |
but that method is deprecated in c++17 and removed in C++20.
MSVC 2019 warns about this when using -Zc:__cplusplus -std:c++17:
src\server\serverContext.cpp(321): warning C4996: 'std::shared_ptr<epics::pvAccess::BlockingUDPTransport>::unique':
warning STL4016: std::shared_ptr::unique() is deprecated in C++17.
You can define _SILENCE_CXX17_SHARED_PTR_UNIQUE_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS
to acknowledge that you have received this warning.
It can be silenced but that may only lead to problems later.
I have not seen a similar warning or error from gcc or clang, even when using -std:c++23.
Metadata
Metadata
Assignees
Labels
No labels