On Wed, Jun 15, 2011 at 2:04 AM, Nico Weber <[email protected]> wrote: > Hi, > > the attached patch produces this diagnostic > > test/Sema/warn-sizeof-arrayarg.c:14:15: warning: sizeof on array > function parameter will return size of 'int *' instead of 'int [10]' > [-Wsizeof-array-argument] > (void)sizeof(a); // \ > ^ > test/Sema/warn-sizeof-arrayarg.c:7:12: note: declared here > void f(int a[10], Arr arr) { // \ > ^ > > for this code: > > void f(int a[10]) { > compute_hash(a, sizeof(a)); > }
Nice! > > It finds 0 bugs and 0 false positives in llvm/clang code and 2 bugs > and 0 false positives in chrome/webkit. > > Ok? > > Nico > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits > > _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
