[PATCH] D32700: [clang-tidy] Add misc-suspicious-memset-usage check.
Reka Kovacs via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon May 1 06:06:02 PDT 2017
rnkovacs created this revision.
Herald added a subscriber: mgorny.
This check finds memset calls with potential mistakes in their arguments.
- Fill value is a character '0'. Integer 0 might have been intended.
- Fill value is out of character range and gets truncated.
- The destination is a this pointer within a class that has a virtual function. It might reset the virtual pointer.
The existing google-runtime-memset-zero-length check is related. It finds cases when the byte count parameter is zero and offers to swap that with the fill value argument. Perhaps the two could be merged while maintaining backward compatibility through an alias. When turned on using the alias name, the check would only examine the count parameter as in the google check.
Any suggestions are appreciated.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 12354 bytes
Desc: not available
More information about the cfe-commits