Message ID | 20170624114612.26842-1-git@johnthomson.fastmail.com.au (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 24/06/17 12:46, John Thomson wrote: > fallthrough in one case is missing the r. > This fails to suppress -Wimplicit-fallthrough warning with GCC7 > > common/libc/vsnprintf.c:388:19: error: this statement may fall through [-Werror=implicit-fallthrough=] > flags |= SIGNED; > ^ > common/libc/vsnprintf.c:390:9: note: here > case 'u': /* Unsigned decimal. */ > ^~~~ > cc1: all warnings being treated as errors > > Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au> I think I noticed this ages ago and didn't have time to fix it. I thought to myself "what's the worst that could happen?" Reviewed and applied, thanks. ~Andrew
diff --git a/common/libc/vsnprintf.c b/common/libc/vsnprintf.c index 1931433..4ec0119 100644 --- a/common/libc/vsnprintf.c +++ b/common/libc/vsnprintf.c @@ -386,7 +386,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) case 'd': case 'i': /* Signed decimal. */ flags |= SIGNED; - /* fallthough */ + /* fallthrough */ case 'u': /* Unsigned decimal. */ base = 10; break;
fallthrough in one case is missing the r. This fails to suppress -Wimplicit-fallthrough warning with GCC7 common/libc/vsnprintf.c:388:19: error: this statement may fall through [-Werror=implicit-fallthrough=] flags |= SIGNED; ^ common/libc/vsnprintf.c:390:9: note: here case 'u': /* Unsigned decimal. */ ^~~~ cc1: all warnings being treated as errors Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au> --- common/libc/vsnprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)