diff options
author | pfg <pfg@FreeBSD.org> | 2015-03-24 20:33:24 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2015-03-24 20:33:24 +0000 |
commit | ff36510cfcf3d8f967bcdc7b01f8e01cc54d5618 (patch) | |
tree | 12b8bf32a3239f2295454bcd1d384d931e12cf44 /include/signal.h | |
parent | 2ef1cdce8ec56c3e9a3a5c90dcdef66388734ad8 (diff) | |
download | FreeBSD-src-ff36510cfcf3d8f967bcdc7b01f8e01cc54d5618.zip FreeBSD-src-ff36510cfcf3d8f967bcdc7b01f8e01cc54d5618.tar.gz |
Introduce nonnull attributes in the signal and pthread headers.
The `nonnull' attribute specifies that some function parameters should be
non-null pointers. This is very useful as it helps the compiler generate
warnings on suspicious code and can also enable some small optimizations.
In clang this is also useful for the static analyzer.
While we could go on defining this all over the tree, it only
makes sense to annotate a subset of critical functions.
Hinted by: Android's bionic libc
Differential Revision: https://reviews.freebsd.org/D2101
Diffstat (limited to 'include/signal.h')
-rw-r--r-- | include/signal.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/signal.h b/include/signal.h index dca19aa..b80fde4 100644 --- a/include/signal.h +++ b/include/signal.h @@ -78,10 +78,10 @@ int sigdelset(sigset_t *, int); int sigemptyset(sigset_t *); int sigfillset(sigset_t *); int sigismember(const sigset_t *, int); -int sigpending(sigset_t *); +int sigpending(sigset_t *) __nonnull(1); int sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict); -int sigsuspend(const sigset_t *); -int sigwait(const sigset_t * __restrict, int * __restrict); +int sigsuspend(const sigset_t *) __nonnull(1); +int sigwait(const sigset_t * __restrict, int * __restrict) __nonnull(1, 2); #endif #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 600 |