remove ineffective compiler assist from printf
authorAlexander Monakov <amonakov@ispras.ru>
Tue, 4 Jul 2017 19:53:12 +0000 (22:53 +0300)
committerRich Felker <dalias@aerifal.cx>
Tue, 4 Jul 2017 22:04:52 +0000 (18:04 -0400)
The switch statement has no 'default:' case and the function ends
immediately following the switch, so the extra comparison did not
communicate any extra information to the compiler.

src/stdio/vfprintf.c
src/stdio/vfwprintf.c

index 8c81efc..15356f5 100644 (file)
@@ -107,8 +107,6 @@ union arg
 
 static void pop_arg(union arg *arg, int type, va_list *ap)
 {
-       /* Give the compiler a hint for optimizing the switch. */
-       if ((unsigned)type > MAXSTATE) return;
        switch (type) {
               case PTR:        arg->p = va_arg(*ap, void *);
        break; case INT:        arg->i = va_arg(*ap, int);
index 1e6e47c..e87ad42 100644 (file)
@@ -98,8 +98,6 @@ union arg
 
 static void pop_arg(union arg *arg, int type, va_list *ap)
 {
-       /* Give the compiler a hint for optimizing the switch. */
-       if ((unsigned)type > MAXSTATE) return;
        switch (type) {
               case PTR:        arg->p = va_arg(*ap, void *);
        break; case INT:        arg->i = va_arg(*ap, int);