aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Paland <marco@paland.com>2018-06-15 12:29:23 +0200
committerMarco Paland <marco@paland.com>2018-06-15 12:29:23 +0200
commit175e466d92d90487ad12149eb4068cb183c28051 (patch)
tree03d8ebf143bb76fe5784b42812d74c85a1d341a6
parent25b02d709fcde653b5a27f35e226427d6eb1705a (diff)
downloadprintf-175e466d92d90487ad12149eb4068cb183c28051.tar.gz
printf-175e466d92d90487ad12149eb4068cb183c28051.tar.bz2
printf-175e466d92d90487ad12149eb4068cb183c28051.zip
fix(printf): fix 'expression is constant' warning
-rw-r--r--printf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/printf.c b/printf.c
index e8c0720..0893216 100644
--- a/printf.c
+++ b/printf.c
@@ -623,7 +623,8 @@ static int _vsnprintf(out_fct_type out, char* buffer, const size_t maxlen, const
width = sizeof(void*) * 2U;
flags |= FLAGS_ZEROPAD | FLAGS_UPPERCASE;
#if defined(PRINTF_SUPPORT_LONG_LONG)
- if (sizeof(uintptr_t) == sizeof(long long)) {
+ const bool is_ll = sizeof(uintptr_t) == sizeof(long long);
+ if (is_ll) {
idx = _ntoa_long_long(out, buffer, idx, maxlen, (uintptr_t)va_arg(va, void*), false, 16U, precision, width, flags);
}
else {