diff options
author | vangyzen <vangyzen@FreeBSD.org> | 2017-06-01 14:49:53 +0000 |
---|---|---|
committer | vangyzen <vangyzen@FreeBSD.org> | 2017-06-01 14:49:53 +0000 |
commit | 2702789d66596515e5e42a691f54e215085cc606 (patch) | |
tree | 05ea3e2a84c4644058d0db1d7e202f94f4c37201 /lib/libc | |
parent | 620a1f702bc800b1daa394089ce1fa63e5e20a5b (diff) | |
download | FreeBSD-src-2702789d66596515e5e42a691f54e215085cc606.zip FreeBSD-src-2702789d66596515e5e42a691f54e215085cc606.tar.gz |
MFC r318539 r318580 r318581 r318584 r318749 r318952 r318953 r318955
libthr: fix warnings at WARNS=6
Fix warnings about the following when WARNS=6 (which I will commit soon):
- casting away const
- no previous 'extern' declaration for non-static variable
- others as explained by #pragmas and comments
- unused parameters
libthr: disable thread-safety warnings
These warnings don't make sense for code that implements
the locking primitives.
libthr: change CHECK_AND_INIT_RWLOCK to an inline function
This was prompted by a compiler warning about 'ret' shadowing
a local variable in the callers of the macro.
libthr: Use CLI flags instead of pragmas to disable warnings
People tweaking the build system or compilers tend to look into
the Makefile and not into the source. Having some warning controls
in the Makefile and some in the source code is surprising.
Pragmas have the advantage that they leave the warnings enabled
for more code, but that advantage isn't very relevant in these cases.
libthr: fix warnings from GCC when WARNS=6
Fix warnings about:
- redundant declarations
- a local variable shadowing a global function (dlinfo)
- an old-style function definition (with an empty parameter list)
- a variable that is possibly used uninitialized
libthr: prevent setcontext() from masking SIGTHR
__thr_setcontext() mistakenly tested for the presence of SIGCANCEL
in its local ucontext_t instead of the parameter. Therefore,
if a thread calls setcontext() with a context whose signal mask
contains SIGTHR (a.k.a. SIGCANCEL), that signal will be blocked,
preventing the thread from being cancelled or suspended.
Sponsored by: Dell EMC
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/include/libc_private.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index 384f61f..2134f34 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -42,7 +42,10 @@ * or more threads. It is used to avoid calling locking functions * when they are not required. */ +#ifndef __LIBC_ISTHREADED_DECLARED +#define __LIBC_ISTHREADED_DECLARED extern int __isthreaded; +#endif /* * Elf_Auxinfo *__elf_aux_vector, the pointer to the ELF aux vector |