On Wed, 16 Nov 2016, Jeff Law wrote:

> On 11/16/2016 05:17 PM, Martin Sebor wrote:
> 
> > > 
> > > (I've heard some noise in C++-land about making memcpy(0,0,0) valid, but
> > > that may have just been noise)
> > 
> > We may have read the same discussion.  It would make some things
> > a little easier in C++ (and remove what most people view as yet
> > another unnecessary gotcha in the language).
> And that may be a reasonable thing to do.
> 
> While GCC does take advantage of the non-null attribute when trying to prove
> certain pointers must be non-null, it only does so when the magic flag is
> turned on.  There was a sense that it was too aggressive and that time may be
> necessary for folks to come to terms with what GCC was doing, particularly in
> the the memcpy (*, *, 0) case -- but I've never gotten the sense that happened
> and we've never turned that flag on by default.

We only have -f[no-]delete-null-pointer-checks and that's on by default.

So we _do_ take advantage of those.

Richard.

Reply via email to