This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: -Wconversion is broken for 'short' parameters.
- To: Veksler Michael <mveksler at techunix dot technion dot ac dot il>
- Subject: Re: -Wconversion is broken for 'short' parameters.
- From: Philipp Thomas <pthomas at suse dot de>
- Date: Thu, 27 Jul 2000 12:31:15 +0200
- Cc: gcc-bugs at gcc dot gnu dot org
- References: <20000727120809.K4247@Jeffreys.suse.de> <Pine.SOL.4.10_heb2.08.10007271313060.14313-100000@techunix.technion.ac.il>
* Veksler Michael (mveksler@techunix.technion.ac.il) [20000727 12:21]:
> (Ommitted 'gcc-bugs@gcc.gnu.org' from the mail):
And taken into agian from me :)
> It looks wrong: short (or char) are promoted to 'int' both in K&R code and
> in ISO C, so why do we need the warning?
No they're not! It's one of the differences between K&R and ISO, that
Arguments don't get default promotion in the presence of prototypes.
In ISO C, only arguments to vararg functions get default promotion (which,
BTW, is the reason why gcc will warn if you do ' va_arg(arg, char)').
Philipp
--
Philipp Thomas <pthomas@suse.de>
Development, SuSE GmbH, Schanzaecker Str. 10, D-90443 Nuremberg, Germany
#define NINODE 50 /* number of in core inodes */
#define NPROC 30 /* max number of processes */
-- Version 7 UNIX for PDP 11, /usr/include/sys/param.h