[PATCH] D52949: [Diagnostics] Implement -Wsizeof-pointer-div
Dávid Bolvanský via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 5 14:41:12 PDT 2018
xbolva00 created this revision.
Herald added a subscriber: cfe-commits.
void test(int *arr) {
int arr_len = sizeof(arr) / sizeof(*arr); // warn, incorrect way to compute number of array elements
}
Enabled under -Wall (same behaviour as GCC)
Repository:
rC Clang
https://reviews.llvm.org/D52949
Files:
include/clang/Basic/DiagnosticGroups.td
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaExpr.cpp
test/Sema/div-sizeof-ptr.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52949.168534.patch
Type: text/x-patch
Size: 4130 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181005/ebb3fafa/attachment.bin>
More information about the cfe-commits
mailing list