HomePhabricator

[clang-tidy] Add bugprone-suspicious-memset-usage check

Description

[clang-tidy] Add bugprone-suspicious-memset-usage check

Created new module bugprone and placed the check in that.

Finds memset() calls with potential mistakes in their arguments.
Replaces and extends the existing google-runtime-memset-zero-length check.

Cases covered:

  • Fill value is a character '0'. Integer 0 might have been intended.
  • Fill value is out of char range and gets truncated.
  • Byte count is zero. Potentially swapped with the fill value argument.

Patch by: Reka Nikolett Kovacs

Differential Revision: https://reviews.llvm.org/D32700

Details

Committed
xazaxJul 14 2017, 5:15 AM
Differential Revision
D32700: [clang-tidy] Add bugprone-suspicious-memset-usage check.
Parents
rL308019: Fix missing "Produced by" field on Run causing UI crash.
Branches
Unknown
Tags
Unknown