diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-06 18:26:33 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-06 18:26:33 +0200 |
commit | 2ab994f7079daa052f8816b72e215e1609d41f76 (patch) | |
tree | 327d8bbe704fec424f8842471873ff41b8c15729 | |
parent | f5018dac21df54647d0982ed4bebd0286d77cc56 (diff) | |
download | busybox-w32-2ab994f7079daa052f8816b72e215e1609d41f76.tar.gz busybox-w32-2ab994f7079daa052f8816b72e215e1609d41f76.tar.bz2 busybox-w32-2ab994f7079daa052f8816b72e215e1609d41f76.zip |
placate gcc-8.0.1 warnings
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | libbb/dump.c | 6 | ||||
-rw-r--r-- | runit/sv.c | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/libbb/dump.c b/libbb/dump.c index db91fcfe7..5941ef902 100644 --- a/libbb/dump.c +++ b/libbb/dump.c | |||
@@ -464,11 +464,9 @@ static const char conv_str[] ALIGN1 = | |||
464 | "\v" "\\""v""\0" | 464 | "\v" "\\""v""\0" |
465 | ; | 465 | ; |
466 | 466 | ||
467 | |||
468 | static void conv_c(PR *pr, unsigned char *p) | 467 | static void conv_c(PR *pr, unsigned char *p) |
469 | { | 468 | { |
470 | const char *str = conv_str; | 469 | const char *str = conv_str; |
471 | char buf[10]; | ||
472 | 470 | ||
473 | do { | 471 | do { |
474 | if (*p == *str) { | 472 | if (*p == *str) { |
@@ -482,7 +480,9 @@ static void conv_c(PR *pr, unsigned char *p) | |||
482 | *pr->cchar = 'c'; | 480 | *pr->cchar = 'c'; |
483 | printf(pr->fmt, *p); | 481 | printf(pr->fmt, *p); |
484 | } else { | 482 | } else { |
485 | sprintf(buf, "%03o", (int) *p); | 483 | char buf[4]; |
484 | /* gcc-8.0.1 needs lots of casts to shut up */ | ||
485 | sprintf(buf, "%03o", (unsigned)(uint8_t)*p); | ||
486 | str = buf; | 486 | str = buf; |
487 | strpr: | 487 | strpr: |
488 | *pr->cchar = 's'; | 488 | *pr->cchar = 's'; |
diff --git a/runit/sv.c b/runit/sv.c index 86d181872..8054daedf 100644 --- a/runit/sv.c +++ b/runit/sv.c | |||
@@ -222,6 +222,7 @@ struct globals { | |||
222 | #define str_equal(s,t) (strcmp((s), (t)) == 0) | 222 | #define str_equal(s,t) (strcmp((s), (t)) == 0) |
223 | 223 | ||
224 | 224 | ||
225 | #if ENABLE_SV || ENABLE_SVC | ||
225 | static void fatal_cannot(const char *m1) NORETURN; | 226 | static void fatal_cannot(const char *m1) NORETURN; |
226 | static void fatal_cannot(const char *m1) | 227 | static void fatal_cannot(const char *m1) |
227 | { | 228 | { |
@@ -688,6 +689,7 @@ static int sv(char **argv) | |||
688 | } | 689 | } |
689 | return rc > 99 ? 99 : rc; | 690 | return rc > 99 ? 99 : rc; |
690 | } | 691 | } |
692 | #endif | ||
691 | 693 | ||
692 | #if ENABLE_SV | 694 | #if ENABLE_SV |
693 | int sv_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 695 | int sv_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |