[signals2] Warn unused result

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[signals2] Warn unused result

Boost - Users mailing list
Hi,

I am using boost::signals2 library for event callback mechanism. The
event register callback function returns a
boost::signals2::scope_connection object for optional disconnect by the
function registering itself.

I want to mandate using the returns result (scoped_connection) object by
the user. So, I use the gcc attribute "__attribute__( (
warn_unused_result ) )" with the function.

The problem is that the compiler does not warn for unused result. Any
ideas, why would this happen?

I am using Linux with g++ 4.8.4 and c++11 is enabled.

Boost version: 1.67.0

I have attached a minimal working example.

Thanks,

-Deven




_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users

main.cpp (781 bytes) Download Attachment