Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/linux-sunxi/sunxi-tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/pio.c
diff options
context:
space:
mode:
authorIan Campbell <ijc@hellion.org.uk>2018-05-27 17:22:57 +0300
committerAndre Przywara <osp@andrep.de>2018-07-09 11:16:25 +0300
commit585cb1d499e980dc7e572a32d79757c61cf26b92 (patch)
treee761e5997f03ccae61556fa172621a7048b73ea4 /pio.c
parentfbe2dee76266f3a4040482cd4b4209c41ac066e3 (diff)
Fix two warnings about implicit fallthrough.
In the first case: pio.c: In function ‘main’: pio.c:355:4: warning: this statement may fall through [-Wimplicit-fallthrough=] usage(0); ^~~~~~~~ pio.c:356:3: note: here case 'm': ^~~~ The fallthrough is not intended because `usage()` never returns (it calls `exit` unconditionally). Annotate as `noreturn` so the compiler realises this. In the second case: fexc.c: In function ‘main’: fexc.c:312:15: warning: this statement may fall through [-Wimplicit-fallthrough=] filename[1] = argv[optind+1]; /* out */ ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ fexc.c:313:2: note: here case 1: ^~~~ The fallthrough appears to be intended (the two argument case is a superset of the one argument case). Annotate with a comment which tells the compiler this is intended. Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Diffstat (limited to 'pio.c')
-rw-r--r--pio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pio.c b/pio.c
index 0e6afd0..09cfaf8 100644
--- a/pio.c
+++ b/pio.c
@@ -165,7 +165,7 @@ static void print(const char *buf)
static const char *argv0;
-static void usage(int rc )
+static __attribute__((noreturn)) void usage(int rc )
{
fputs("sunxi-pio " VERSION "\n\n", stderr);
fprintf(stderr, "usage: %s -m|-i input [-o output] pin..\n", argv0);