[cfe-dev] Add attribute for return values that shouldn't be cast to bool

Anton Urusov via cfe-dev cfe-dev at lists.llvm.org
Mon Sep 19 07:09:41 PDT 2016


Hi,

I’ve been working on a patch that adds a new attribute (warn_impcast_to_bool)
to indicate that the return value of a function shouldn't be used as a
boolean, as well as a compile warning and a StaticAnalyzer checker to warn
about misusing functions with this attribute. This change is inspired by
the CVE-2008-5077 in OpenSSL (
https://www.openssl.org/news/secadv/20090107.txt).

Anna Zaks suggested that I should also propose it on cfe-dev as well as
cfe-commits. The patch is available at https://reviews.llvm.org/D24507; any
additional feedback welcome.

Regards, Anton Urusov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160919/e401d347/attachment.html>


More information about the cfe-dev mailing list