aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Peterson <cpeterson@mozilla.com>2016-03-26 01:19:28 -0700
committerJason Evans <jasone@canonware.com>2016-03-26 23:24:33 -0700
commit0bc716ae27d1bd66faa8f165a2c4a4cf6bd8143f (patch)
tree7d06de12d64bd23679e73f0183f883a802d2b177 /src
parentf3060284c521cc74e333c5ab3a6c8fc0648defb5 (diff)
downloadjemalloc-0bc716ae27d1bd66faa8f165a2c4a4cf6bd8143f.tar.gz
Fix -Wunreachable-code warning in malloc_vsnprintf().
Variables s and slen are declared inside a switch statement, but outside a case scope. clang reports these variable definitions as "unreachable", though this is not really meaningful in this case. This is the only -Wunreachable-code warning in jemalloc. src/util.c:501:5 [-Wunreachable-code] code will never be executed This resolves #364.
Diffstat (limited to 'src')
-rw-r--r--src/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util.c b/src/util.c
index 581d540..a1c4a2a 100644
--- a/src/util.c
+++ b/src/util.c
@@ -408,6 +408,8 @@ malloc_vsnprintf(char *str, size_t size, const char *format, va_list ap)
int prec = -1;
int width = -1;
unsigned char len = '?';
+ char *s;
+ size_t slen;
f++;
/* Flags. */
@@ -498,8 +500,6 @@ malloc_vsnprintf(char *str, size_t size, const char *format, va_list ap)
}
/* Conversion specifier. */
switch (*f) {
- char *s;
- size_t slen;
case '%':
/* %% */
APPEND_C(*f);