This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: -Wconversion is broken for 'short' parameters.


* 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]