On Fri, 27 Jun 2014, Marek Polacek wrote: > The following is a revamped patch for -Wsizeof-array-argument. Almost two > months back there was an initial attempt by Prathamesh: > <https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00142.html>, but that patch > never made it in. This version implements the warning for both C and C++ > FEs, adds more testing, enables the warning by default (I can move it to > -Wall, of course), makes the warning work properly even for multidimensional > arrays, etc. > Its purpose is to detect suspicious usage of the sizeof operator on an array > function parameter. A few years back I fixed exactly this kind of bug in > elfutils - so -Wsizeof-array-argument might be indeed useful. (The warning > didn't > trigger during GCC bootstrap though.) > > Jason/Joseph, could you please look at the C++, resp. C FE parts?
The C changes are OK. -- Joseph S. Myers jos...@codesourcery.com