snprintf: fix compilation with GCC 7 (#108)

GCC 7 enables -Wimplicit-fallthrough=3 with -Wextra. Add comments to
suppress these warning explicitly.

Reported by @akoww
This commit is contained in:
Dmitry Podgorny
2017-07-11 03:17:40 +03:00
parent 4aa7ea7e5b
commit 212f3ea760

View File

@@ -286,6 +286,7 @@ static int dopr (char *buffer, size_t maxlen, const char *format, va_list args)
break; break;
case 'X': case 'X':
flags |= DP_F_UP; flags |= DP_F_UP;
//-fallthrough
case 'x': case 'x':
flags |= DP_F_UNSIGNED; flags |= DP_F_UNSIGNED;
if (cflags == DP_C_SHORT) if (cflags == DP_C_SHORT)
@@ -306,6 +307,7 @@ static int dopr (char *buffer, size_t maxlen, const char *format, va_list args)
break; break;
case 'E': case 'E':
flags |= DP_F_UP; flags |= DP_F_UP;
//-fallthrough
case 'e': case 'e':
if (cflags == DP_C_LDOUBLE) if (cflags == DP_C_LDOUBLE)
fvalue = va_arg (args, LDOUBLE); fvalue = va_arg (args, LDOUBLE);
@@ -314,6 +316,7 @@ static int dopr (char *buffer, size_t maxlen, const char *format, va_list args)
break; break;
case 'G': case 'G':
flags |= DP_F_UP; flags |= DP_F_UP;
//-fallthrough
case 'g': case 'g':
if (cflags == DP_C_LDOUBLE) if (cflags == DP_C_LDOUBLE)
fvalue = va_arg (args, LDOUBLE); fvalue = va_arg (args, LDOUBLE);