summaryrefslogtreecommitdiffstats
path: root/include/signal.h
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2017-03-14 20:14:57 +0000
committerpfg <pfg@FreeBSD.org>2017-03-14 20:14:57 +0000
commit8c08bfe0a237cbc568a58adcefa2b61e7a46fa9d (patch)
tree885ac3dd460b34cb7e8b9a30b568a3592fb4725e /include/signal.h
parent85fddbd8bf2c10c05892daf14ffca4458f839f38 (diff)
downloadFreeBSD-src-8c08bfe0a237cbc568a58adcefa2b61e7a46fa9d.zip
FreeBSD-src-8c08bfe0a237cbc568a58adcefa2b61e7a46fa9d.tar.gz
MFC r312934:
Make use of clang nullability attributes in C headers. Replace uses of the GCC __nonnull__ attribute with the clang nullability qualifiers. These are starting to get use in clang's static analyzer. Replacement should be transparent for developers using clang. GCC ports from older FreeBSD versions may need updating if the compiler was built before r312860 (Jan-27-2017). Hinted by: Apple's Libc-1158.20.4, Bionic libc Relnotes: yes
Diffstat (limited to 'include/signal.h')
-rw-r--r--include/signal.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/signal.h b/include/signal.h
index 9d874de..f9b6923 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -41,6 +41,8 @@
#include <sys/_ucontext.h>
#endif
+__NULLABILITY_PRAGMA_PUSH
+
#if __BSD_VISIBLE
/*
* XXX should enlarge these, if only to give empty names instead of bounds
@@ -82,10 +84,11 @@ 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);
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);
+int sigwait(const sigset_t * _Nonnull __restrict,
+ int * _Nonnull __restrict);
#endif
#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 600
@@ -104,7 +107,7 @@ int sighold(int);
int sigignore(int);
int sigpause(int);
int sigrelse(int);
-void (*sigset(int, void (*)(int)))(int);
+void (* _Nullable sigset(int, void (* _Nullable)(int)))(int);
int xsi_sigpause(int);
#endif
@@ -124,5 +127,6 @@ int sigstack(const struct sigstack *, struct sigstack *);
int sigvec(int, struct sigvec *, struct sigvec *);
#endif
__END_DECLS
+__NULLABILITY_PRAGMA_POP
#endif /* !_SIGNAL_H_ */
OpenPOWER on IntegriCloud