Ticket #3467: mc-3467-cleanup-unreachable_code-warning.patch

File mc-3467-cleanup-unreachable_code-warning.patch, 2.2 KB (added by and, 9 years ago)
  • m4.include/mc-cflags.m4

    fix -Wunreachable-code warnings and add to mc cflags
    
    input_complete.c:1170:9: warning: 'break' will never be executed [-Wunreachable-code-break]
    ascii.c:291:12: error: 'return' will never be executed [-Wunreachable-code-return]
    cons.saver.c:211:9: warning: 'break' will never be executed [-Wunreachable-code-break]
    hotlist.c:860:9: error: code will never be executed [-Werror,-Wunreachable-code]
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    
    a b  
    8484    MC_CHECK_ONE_CFLAG([-Wtype-limits]) 
    8585    MC_CHECK_ONE_CFLAG([-Wundef]) 
    8686    MC_CHECK_ONE_CFLAG([-Wuninitialized]) 
     87    MC_CHECK_ONE_CFLAG([-Wunreachable-code]) 
    8788    MC_CHECK_ONE_CFLAG([-Wunused-but-set-variable]) 
    8889    MC_CHECK_ONE_CFLAG([-Wunused-function]) 
    8990    MC_CHECK_ONE_CFLAG([-Wunused-label]) 
  • lib/widget/input_complete.c

    a b  
    10701070                /* This means we want to refill the list box and start again */ 
    10711071                h->ret_value = B_USER; 
    10721072                dlg_stop (h); 
    1073                 return MSG_HANDLED; 
    10741073            } 
    10751074            else 
    10761075            { 
     
    11651164                } 
    11661165                bl = 0; 
    11671166            } 
    1168             return MSG_HANDLED; 
    11691167        } 
    1170         break; 
     1168        return MSG_HANDLED; 
    11711169 
    11721170    default: 
    11731171        return dlg_default_callback (w, sender, msg, parm, data); 
  • src/viewer/ascii.c

    a b  
    286286    return g_unichar_isprint (c); 
    287287#else 
    288288    (void) view; 
    289 #endif /* HAVE_CHARSET */ 
    290289    /* TODO this is very-very buggy by design: ticket 3257 comments 0-1 */ 
    291290    return is_printable (c); 
     291#endif /* HAVE_CHARSET */ 
    292292} 
    293293 
    294294/* --------------------------------------------------------------------------------------------- */ 
  • src/consaver/cons.saver.c

    a b  
    208208        break; 
    209209    default: 
    210210        die (); 
    211         break; 
    212211    } 
    213212 
    214213    snprintf (console_name, sizeof (console_name), p, console_minor); 
  • src/filemanager/hotlist.c

    a b  
    856856{ 
    857857    dlg_destroy (hotlist_dlg); 
    858858    l_hotlist = NULL; 
    859     if (FALSE) 
    860         update_panels (UP_OPTIMIZE, UP_KEEPSEL); 
    861859    repaint_screen (); 
    862860} 
    863861