[patch] 1.11.0.svn: compiler warnings when building for i386 arch

Denys Vlasenko vda.linux at googlemail.com
Thu May 15 14:28:26 PDT 2008


On Wednesday 14 May 2008 23:52, Cristian Ionescu-Idbohrn wrote:
> On Tue, 13 May 2008, Denys Vlasenko wrote:
> 
> > On Monday 12 May 2008 23:50, Cristian Ionescu-Idbohrn wrote:
> > > On Mon, 12 May 2008, Denys Vlasenko wrote:
> > >
> > > > Patch is applied with minor corrections, thanks.
> > >
> > > Sorry, but I'm a bit confused.  After synchning with svn i still find
> > > some 26 files not being touched :(
> >
> > That was a different patch, which I didn't reviewed yet.
> 
> I see.
> 
> > I think I applied all of them to svn, let me know if I missed anything.
> 
> Not sure.  I think not.  But here are some more.

-		if (opt == EOF)
+		if ((int)opt == EOF)

First, getopt manpage says that it returns -1, not EOF
(EOF is an stdio.h thing and seem to be unrelated). Second,
it's better to change opt from unsigned to int.

-	int i;
+	size_t i;
 	for (i = 0; i < ARRAY_SIZE(out_spec); i++) {

On some arches size_t is 64 bit. I will change ARRAY_SIZE macro to return
unsigned instead.

+			// mode can't be -a as it's declared 'unsigned int'
 			if ((mode != -1) && (chmod(full_name, mode) < 0)){

I removed mode != -1 checks.

+	// m_addr can't be < 0 as it'ss declared 'uint32_t'
 	if (m_addr == -1) switch (errno) {

I added a cast: (ElfW(Addr))(-1)

-		while (1) {
+		while (sz >= 0) {

Why?

-	int i, lineno;
+	size_t i, lineno;
 
 	for (i = 0; i < KWS_WITH_DEFAULTS; i++)
 		keywords[i].handler(keywords[i].def, keywords[i].var);
@@ -344,7 +344,7 @@
 		for (i = 0; i < ARRAY_SIZE(keywords); i++) {
 			if (!strcasecmp(token, keywords[i].keyword)) {
 				if (!keywords[i].handler(line, keywords[i].var)) {
-					bb_error_msg("can't parse line %d in %s at '%s'",
+					bb_error_msg("can't parse line %u in %s at '%s'",
 							lineno, file, line);

size_t can't be printed with %u


-static int inline smtp_check(const char *fmt, int code)
+static ALWAYS_INLINE int smtp_check(const char *fmt, int code)
 {
 	return smtp_checkp(fmt, NULL, code);
 }
@@ -224,7 +224,7 @@
 	bb_error_msg_and_die("%s failed", msg);
 }
 
-static void inline pop3_check(const char *fmt, const char *param)
+static ALWAYS_INLINE void pop3_check(const char *fmt, const char *param)

This is unrelated change, and it increases code size:

sendgetmail_main                                    1674    1700     +26

Do not put unrelated changes into your patches.

> It seems I found a couple of bugs too.  ';' character present where it
> shouldn't.  See patches for these files:
> 
>   networking/interface.c
>   networking/isrv_identd.c

These two fixes applied too, thanks!
--
vda


More information about the busybox mailing list