Skip to contentSkip to conversation

Fix fallthrough typo in XTF common/libc/vsnprintf.c

PATCH In review John Thomson 2 participants 2 messages Jun 24, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix fallthrough typo in XTF common/libc/vsnprintf.c

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

---
 common/libc/vsnprintf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/libc/vsnprintf.c +1 -1
index 1931433..4ec0119 100644
@@ -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;
Signature · 7 lines
2.13.1


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw
Quoted 4 lines · John Thomson

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=]

Quoted 8 lines
             flags |= SIGNED;
                   ^

common/libc/vsnprintf.c:390:9: note: here
case 'u': /* Unsigned decimal. */
^~~~
cc1: all warnings being treated as errors

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

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel