delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/09/16/10:22:34

Message-ID: <37E0FC2C.E9D19E60@softhome.net>
Date: Thu, 16 Sep 1999 16:18:20 +0200
From: Laurynas Biveinis <lauras AT softhome DOT net>
X-Mailer: Mozilla 4.61 [en] (Win98; I)
X-Accept-Language: lt,en
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
CC: DJGPP Workers <djgpp-workers AT delorie DOT com>
Subject: Re: Signed - unsigned comparison in dosexe.c
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990916123115 DOT 7654J-100000 AT is>
Reply-To: djgpp-workers AT delorie DOT com

Eli Zaretskii wrote:
> Did GCC 2.95 compile that without any warning?  I'd expect it to say

No. "-Wall -W -Werror" went clearly. Yes, I'd expect some
warning too, but there isn't any,

> something, since the code does this (much later):
> 
>   i = (*spawnfunc)(P_WAIT, pinterp, newargs, envp);
>   return i;
> 
> Not only can *spawnfunc return a negative value, but the function
> itself is declared as returning an int, not an unsigned int.

In other case I would suggest keeping one signed and one unsigned 
variable, but why not replace that code above to

return (*spawnfunc)(P_WAIT, pinterp, newargs, envp);

and eliminating need for i here?

> So I think this should be fixed differently.  In any case, the library
> is not guaranteed to be compatible with GCC 2.95 yet; there are
> probably more problems to sort out.

I don't think it's a GCC 2.95 problem; it's a compiler switch "-W" problem.

BTW, GCC 2.95.1 works well for me, haven't any problems so far.

Laurynas Biveinis

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019