On Wed, Feb 10, 2016 at 04:21:02PM +0000, Alexander Kornienko via cfe-commits wrote: > alexfh added a comment. > > Thank you for working on this check! > > I'd like to note that there is a library-side way to mitigate this > issue using the `[[clang::warn_unused_result]]` attribute on > `vector::empty()` and similar methods:
I'm not a big fan of this. Those calls are by the very definition harmless, so they aggrevate the existing problem of stupid annotation. The original intention of this attribute was to flag cases of side effects where ignoring the the result is a definite bug. Consider calling malloc or realloc and throwing away the result -- that never makes sense. Then GNU came along and starting to annotate various libc functions including most of the stdio family. Guess what, standard streams have a (sticky) error flag, exactly so that you don't have check every single call. Congratulation, people are just starting to ignore the warnings now. Fast forward and we have this suggestion... Joerg _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits