Ticket #3876: mc-3876-utilunix.c-Cleanup-implicit-fallthrough-warning.patch

File mc-3876-utilunix.c-Cleanup-implicit-fallthrough-warning.patch, 1.0 KB (added by and, 7 years ago)
  • lib/utilunix.c

    From 80790d482ce074a5e8a412afebc8fb4c2af92468 Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Wed, 3 Jan 2018 22:39:07 +0000
    Subject: [PATCH] (utilunix.c): Cleanup implicit-fallthrough warning
    
    Found by GCC 7.2.0
    
    utilunix.c: In function 'my_systemv':
    utilunix.c:455:13: error: this statement may fall through [-Werror=implicit-fallthrough=]
                 my_exit (127);      /* Exec error */
                 ^~~~~~~~~~~~~
    utilunix.c:458:5: note: here
         default:
         ^~~~~~~
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     lib/utilunix.c | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/lib/utilunix.c b/lib/utilunix.c
    index f2050bcdb..92ddd4cf9 100644
    a b my_systemv (const char *command, char *const argv[]) 
    454454            execvp (command, argv); 
    455455            my_exit (127);      /* Exec error */ 
    456456        } 
     457        MC_FALLTHROUGH; 
    457458        /* no break here, or unreachable-code warning by no returning my_exit() */ 
    458459    default: 
    459460        status = 0;