[PATCH] D49112: [Sema] Implement -Wmemset-transposed-args

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 18 06:20:11 PDT 2018


aaron.ballman added inline comments.


================
Comment at: clang/lib/Sema/SemaChecking.cpp:7975-7976
+static void CheckMemsetSizeof(Sema &S, unsigned BId, const CallExpr *Call) {
+  if (BId != Builtin::BImemset)
+    return;
+
----------------
erik.pilkington wrote:
> aaron.ballman wrote:
> > This functionality should apply equally to `wmemset()` as well, should it not? The only difference I can think of would be that the type should be cast to `wchar_t` instead of `int` to silence the warning.
> Looks like clang doesn't have a builtin for wmemset, its just defined as a normal function. I suppose that we could still try to diagnose calls to top-level functions named wmemset, but thats unprecedented and doesn't really seem worth the trouble.
I'm fine leaving it off then; I agree it's not worth the trouble.


https://reviews.llvm.org/D49112





More information about the cfe-commits mailing list