delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/06/10/08:30:50

Date: Sun, 10 Jun 2001 15:32:24 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Tim Van Holder <tim DOT van DOT holder AT pandora DOT be>
cc: djgpp-workers AT delorie DOT com
Subject: Re: Compiler options for djdev build
In-Reply-To: <CAEGKOHJKAAFPKOCLHDIKEALCEAA.tim.van.holder@pandora.be>
Message-ID: <Pine.SUN.3.91.1010610152710.7564D-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sun, 10 Jun 2001, Tim Van Holder wrote:

> Well, in order to "fix" this, you change the type used - i.e. you make
> todigit() and friends take an int, not a char.  But you're not passing an
> integer value, you're actually passing a character value - as such,
> declaring the argument as int seems wrong.

It's not wrong, it's very natural in C, if you think about a function 
invocation as a kind of expression (which it is).  All integral types 
shorter than int are always promoted to int's in an expression.

> The warning is only useful when converting legacy C code

The DJGPP library has quite a lot of such legacy code, most of it going 
back to the BSD library, originally used by DJ for v1.x.  The timezone 
code (djtzs*.zip) is also ``legacy code'', as well as edebug and fsdb.

> As you say, converting a function to varargs may trigger breakage, but how
> likely is that to happen?

I don't know.  But it seems a good idea to pay such a small price for 
added safety.

- Raw text -


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