[PATCH] -Wsizeof-pointer-memaccess improvements (PR c/54381)

Joseph S. Myers joseph@codesourcery.com
Fri Oct 12 15:52:00 GMT 2012


On Wed, 10 Oct 2012, Jakub Jelinek wrote:

> Hi!
> 
> This is something Florian requested on ml and Gerard in bugzilla
> after -Wsizeof-pointer-memaccess has been added in August for the C FE,
> but I've been deferring the work until C++ FE support will be in too.
> 
> It adds diagnostics to some more builtins (stpncpy, bcopy, bcmp, bzero,
> snprintf and vsnprintf), also __builtin_*_chk for all the old and new
> builtins where applicable, and changes the wording of *cmp* builtin
> diagnostics (which don't have source/destination arguments, but two source
> arguments).
> 
> To support e.g. snprintf/vsnprintf, I had to change the FEs a little bit,
> now first 3 arguments are remembered whether they were sizeof, their
> original arguments and locus, instead of the last argument.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

The C front-end changes are OK.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list