diff options
author | pfg <pfg@FreeBSD.org> | 2017-03-14 20:14:57 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2017-03-14 20:14:57 +0000 |
commit | 8c08bfe0a237cbc568a58adcefa2b61e7a46fa9d (patch) | |
tree | 885ac3dd460b34cb7e8b9a30b568a3592fb4725e /lib/libthr/thread | |
parent | 85fddbd8bf2c10c05892daf14ffca4458f839f38 (diff) | |
download | FreeBSD-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 'lib/libthr/thread')
-rw-r--r-- | lib/libthr/thread/thr_private.h | 12 |
1 files changed, 7 insertions, 5 deletions
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 <sys/thr.h> #include <pthread.h> +__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 <fcntl.h> */ #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 */ |