[patch] fix docs for C++ warn_unused type attribute
Wed Feb 17 14:49:00 GMT 2016
that attribute((warn_unused)) is not useful for std::mutex because it
controls a resource. That's incorrect, std::mutex *is* a resource, but
it doesn't control one. In fact declaring std::mutex as a local
variable and then never using it almost certainly is a mistake,
because it won't be locked unless you use it.
A better example of a type that controls a resource would be
std::lock_guard, which you would typically construct and then never
refer to again (because everything interesting happens in the
constructor and destructor).
OK for trunk?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 757 bytes
Desc: not available
More information about the Gcc-patches