]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add a new __sentinel attribute.
authorpfg <pfg@FreeBSD.org>
Mon, 29 Jun 2015 00:30:30 +0000 (00:30 +0000)
committerpfg <pfg@FreeBSD.org>
Mon, 29 Jun 2015 00:30:30 +0000 (00:30 +0000)
commitdf33b4e60849441d2371c86bf57ddf42a0563637
treef3a6dacc750a1042d5fb31eade998fb08a480bb0
parent2120b1ed16dc65b7d4b2ab07ed54f3a7282eb12a
Add a new __sentinel attribute.

The sentinel attribute was originally implemented in OpenBSD's gcc and
later adopted by upstream GCC 4.0 (and clang). From the OpenBSD's
gcc-local manpage:

-   gcc recognizes the extra attribute __sentinel__, which can be used to
    mark varargs function that need a NULL pointer to mark argument
    termination, like execl(3).  This exposes latent bugs for 64-bit
    architectures, where a terminating 0 will expand to a 32-bit int, and
    not a full-fledged 64-bits pointer.

While here sort the visibility attributes.

Hinted-by: OpenBSD
sys/sys/cdefs.h