[cfe-dev] [LLVMdev] RFC: Adding attribute(nonnull) to things in libc++
joerg at britannica.bec.de
Tue Jun 2 04:34:51 PDT 2015
On Tue, Jun 02, 2015 at 12:49:11PM +0200, Benjamin Kramer wrote:
> > On 01.06.2015, at 23:14, Joerg Sonnenberger <joerg at britannica.bec.de> wrote:
> > On Mon, Jun 01, 2015 at 10:52:20AM -0700, Marshall Clow wrote:
> >> P.S. recent gcc (at least 4.8.x and later) make optimizations based on
> >> this UB (i.e, if you pass a pointer to memcpy, then it can't be NULL).
> > BTW, this seems to be more an issue with glibc adding the tagging and
> > not behavior of GCC itself.
> GCC also adds nonnull attributes via its builtin functions mechanism.
I don't see it on NetBSD with GCC 4.8.4, so a plain prototype doesn't
seeem to trigger it.
More information about the cfe-dev