mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 21:23:06 +00:00
Enable a few additional warnings for CI and fix the issues they uncovered
- `-Wmissing-prototypes` and `-Wmissing-variable-declarations` are helpful for finding dead code and/or things that should be `static` but aren't marked as such. - `-Wunused-macros` is of similar utility, but for identifying dead macros. - `-Wunreachable-code` and `-Wunreachable-code-aggressive` do exactly what they say: flag unreachable code.
This commit is contained in:
committed by
Qi Wang
parent
d2c9ed3d1e
commit
da66aa391f
25
src/ctl.c
25
src/ctl.c
@@ -1861,31 +1861,6 @@ ctl_mtx_assert_held(tsdn_t *tsdn) {
|
||||
* There's a lot of code duplication in the following macros due to limitations
|
||||
* in how nested cpp macros are expanded.
|
||||
*/
|
||||
#define CTL_RO_CLGEN(c, l, n, v, t) \
|
||||
static int \
|
||||
n##_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, \
|
||||
size_t *oldlenp, void *newp, size_t newlen) { \
|
||||
int ret; \
|
||||
t oldval; \
|
||||
\
|
||||
if (!(c)) { \
|
||||
return ENOENT; \
|
||||
} \
|
||||
if (l) { \
|
||||
malloc_mutex_lock(tsd_tsdn(tsd), &ctl_mtx); \
|
||||
} \
|
||||
READONLY(); \
|
||||
oldval = (v); \
|
||||
READ(oldval, t); \
|
||||
\
|
||||
ret = 0; \
|
||||
label_return: \
|
||||
if (l) { \
|
||||
malloc_mutex_unlock(tsd_tsdn(tsd), &ctl_mtx); \
|
||||
} \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
#define CTL_RO_CGEN(c, n, v, t) \
|
||||
static int \
|
||||
n##_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, \
|
||||
|
||||
Reference in New Issue
Block a user