From 8c08bfe0a237cbc568a58adcefa2b61e7a46fa9d Mon Sep 17 00:00:00 2001 From: pfg Date: Tue, 14 Mar 2017 20:14:57 +0000 Subject: 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 --- lib/libthr/thread/thr_private.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib/libthr/thread/thr_private.h') diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h index e61ee99..9bea65f 100644 --- a/lib/libthr/thread/thr_private.h +++ b/lib/libthr/thread/thr_private.h @@ -53,6 +53,8 @@ #include #include +__NULLABILITY_PRAGMA_PUSH + #define SYM_FB10(sym) __CONCAT(sym, _fb10) #define SYM_FBP10(sym) __CONCAT(sym, _fbp10) #define WEAK_REF(sym, alias) __weak_reference(sym, alias) @@ -835,11 +837,10 @@ void _pthread_cleanup_pop(int); void _pthread_exit_mask(void *status, sigset_t *mask) __dead2 __hidden; void _pthread_cancel_enter(int maycancel); void _pthread_cancel_leave(int maycancel); -int _pthread_mutex_consistent(pthread_mutex_t *) __nonnull(1); -int _pthread_mutexattr_getrobust(pthread_mutexattr_t *__restrict, - int *__restrict) __nonnull_all; -int _pthread_mutexattr_setrobust(pthread_mutexattr_t *, int) - __nonnull(1); +int _pthread_mutex_consistent(pthread_mutex_t * _Nonnull); +int _pthread_mutexattr_getrobust(pthread_mutexattr_t * _Nonnull __restrict, + int * _Nonnull __restrict); +int _pthread_mutexattr_setrobust(pthread_mutexattr_t * _Nonnull, int); /* #include */ #ifdef _SYS_FCNTL_H_ @@ -984,5 +985,6 @@ void __thr_pshared_atfork_pre(void) __hidden; void __thr_pshared_atfork_post(void) __hidden; __END_DECLS +__NULLABILITY_PRAGMA_POP #endif /* !_THR_PRIVATE_H */ -- cgit v1.1