[patch] clears -Wall warnings (was: [patch] shell/ash.c: -W<something> warnings)
Denys Vlasenko
vda.linux at googlemail.com
Sun May 18 22:29:50 UTC 2008
On Sunday 18 May 2008 22:06, Cristian Ionescu-Idbohrn wrote:
> On Sun, 18 May 2008, Denys Vlasenko wrote:
>
> > On Sunday 18 May 2008 14:17, Cristian Ionescu-Idbohrn wrote:
> > > This patch reduces the number of compiler warnings from 39 (svn) to 7.
> > > Warning options used:
> > >
> > > -Wconversion -Wformat=2 -W -Wbad-function-cast -Wall -Wpointer-arith
> >
> > What do you think about first finishing with -Wall warnings only,
> > adding -Wall to standard bbox buildd options (in Makefile.flags file),
> > and only then adding more -W opts?
>
> Alright. The attach patch should do it.
> And yes. You'll also find some "unrelated changes" (for warnings
> showing up when othe -W<option> is used) in that patch. They're because I
> want to forget about them later on.
- get_terminal_width_height(0, &output_width, NULL);
+ get_terminal_width_height(0, &output_width, (unsigned *)NULL);
This cast is not needed.
I applied as much of this patch as needed for -Wall to not complain,
and enabled -Wall in standard build. In fact, it was already enabled,
but we also had -Wno-pointer-sign, which hid pointer warnings.
Now it is removed.
I do not think adding -W options which will make it necessary to have
changes like this:
- col = snprintf(line_buf, scr_width,
+ col = snprintf(line_buf, (size_t)scr_width,
is useful.
--
vda
More information about the busybox
mailing list