www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/06/10/06:48:28

From: "Tim Van Holder" <tim DOT van DOT holder AT pandora DOT be>
To: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Cc: <djgpp-workers AT delorie DOT com>
Subject: Re: Compiler options for djdev build
Date: Sun, 10 Jun 2001 12:49:19 +0200
Message-ID: <CAEGKOHJKAAFPKOCLHDIKEALCEAA.tim.van.holder@pandora.be>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
In-reply-to: <Pine.SUN.3.91.1010610125957.6827B-100000@is>
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
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

> > IMHO, the annoyance of getting this kind of warning far outweighs the
> > usefulness of getting 'x = -1' (where x is unsigned) flagged (the only
> > other effect of -Wconversion).
>
> Unlike other warnings, this one is so easy to fix that I wouldn't call it
> annoyance.

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.  Other standard functions take ints where
you would expect chars, but that is because prototypes originally weren't
required; we require prototypes, so it is not an issue for us.

> For such a low price, I fail to see why is this flag met with such a
> staunch opposition.  Are you saying that it is useless in general, and
> that GCC maintainers should have never added it?

I don't consider this a 'low price', I consider it a kludge.  The warning is
only useful when converting legacy C code, so that you know that a prototype
you added had a potentially undesirable effect.
As you say, converting a function to varargs may trigger breakage, but how
likely is that to happen?

- Raw text -


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