From a00ca4770f53d1d1a4025e4d6ab33281c1a40383 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Sun, 26 Oct 2014 23:30:51 -0500 Subject: [PATCH] Eliminate or disable all the warnings given by clang -Wall --- build | 5 +++-- libbb/appletlib.c | 1 + libbb/xfuncs_printf.c | 2 +- shell/hush.c | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/build b/build index ca51a5bf1..89639dc33 100755 --- a/build +++ b/build @@ -1,6 +1,7 @@ -gcc -Wp,-MD,shell/.hush.o.d -std=gnu99 -Wall -o hush \ +cc -std=c99 \ +-Wall -Wno-format-security -Wno-comment -o hush \ -Iinclude -include include/autoconf.h \ --Dhush_main=main -D_GNU_SOURCE -DNDEBUG -D"BB_VER=KBUILD_STR(1.22.1)" -D"KBUILD_STR(s)=#s" \ +-Dhush_main=main -DNDEBUG -D"BB_VER=KBUILD_STR(1.22.1)" -D"KBUILD_STR(s)=#s" \ shell/hush.c \ shell/match.c \ shell/math.c \ diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 140f3c9ed..1852da245 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c @@ -16,4 +16,5 @@ void FAST_FUNC bb_show_usage(void) { + xfunc_die(); } diff --git a/libbb/xfuncs_printf.c b/libbb/xfuncs_printf.c index e4ac6a002..84fd26c26 100644 --- a/libbb/xfuncs_printf.c +++ b/libbb/xfuncs_printf.c @@ -251,7 +251,7 @@ off_t FAST_FUNC xlseek(int fd, off_t offset, int whence) off_t off = lseek(fd, offset, whence); if (off == (off_t)-1) { if (whence == SEEK_SET) - bb_perror_msg_and_die("lseek(%"OFF_FMT"u)", offset); + bb_perror_msg_and_die("lseek(%"PRIdMAX")", (intmax_t)offset); bb_perror_msg_and_die("lseek"); } return off; diff --git a/shell/hush.c b/shell/hush.c index ad1b8da09..ae23afb54 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -5322,7 +5322,7 @@ static NOINLINE int expand_vars_to_list(o_string *output, int n, char *arg) } else /* If EXP_FLAG_SINGLEWORD, we handle assignment 'a=....$@.....' * and in this case should treat it like '$*' - see 'else...' below */ - if (first_ch == ('@'|0x80) /* quoted $@ */ + if ((unsigned char)first_ch == ('@'|0x80) /* quoted $@ */ && !(output->o_expflags & EXP_FLAG_SINGLEWORD) /* not v="$@" case */ ) { while (1) {