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:
@@ -286,6 +286,7 @@ static int dopr (char *buffer, size_t maxlen, const char *format, va_list args)
|
||||
break;
|
||||
case 'X':
|
||||
flags |= DP_F_UP;
|
||||
//-fallthrough
|
||||
case 'x':
|
||||
flags |= DP_F_UNSIGNED;
|
||||
if (cflags == DP_C_SHORT)
|
||||
@@ -306,6 +307,7 @@ static int dopr (char *buffer, size_t maxlen, const char *format, va_list args)
|
||||
break;
|
||||
case 'E':
|
||||
flags |= DP_F_UP;
|
||||
//-fallthrough
|
||||
case 'e':
|
||||
if (cflags == DP_C_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;
|
||||
case 'G':
|
||||
flags |= DP_F_UP;
|
||||
//-fallthrough
|
||||
case 'g':
|
||||
if (cflags == DP_C_LDOUBLE)
|
||||
fvalue = va_arg (args, LDOUBLE);
|
||||
|
||||
Reference in New Issue
Block a user