r278264 - Reapply [Sema] Add sizeof diagnostics for bzero

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 11 11:42:00 PDT 2016


On Thu, Aug 11, 2016 at 5:43 AM, Joerg Sonnenberger via cfe-commits
<cfe-commits at lists.llvm.org> wrote:
>
> On Wed, Aug 10, 2016 at 02:36:01PM -0700, Bruno Cardoso Lopes wrote:
> > Hi Joerg,
> >
> > > Given that bzero is pretty much non-standard at this point, I strongly
> > > dislike the approach of checking only the function name.
> >
> > Thanks for the feedback. bzero it's widely used though, I think it's a
> > usability win to perform a diagnostic here, despite bzero being
> > non-standard.
>
> Oh, I don't disagree that it is useful. Some projects still have a
> ridiculous amount of non-standard bzero and bcmp invocations.
>
> >
> > Is there any additional reason why you dislike it or additional checks
> > you suggest? IIUC, Sema::CheckMemaccessArguments already checks if the
> > number of arguments is the same and if they are indeed what they're
> > supposed to be.
>
> It checks the number of arguments, but that's about it. It doesn't for
> example check that the first argument is a pointer.

Right, it does not specifically check it's the first. Fixed in r278379.

-- 
Bruno Cardoso Lopes
http://www.brunocardoso.cc


More information about the cfe-commits mailing list