Mail Archives: djgpp/1996/05/17/00:18:58
Eli Zaretskii (eliz AT is DOT elta DOT co DOT il) wrote:
: On Fri, 10 May 1996, Rainer Wank wrote:
: > 1.) You wrote, ELI ZARETSKII, that what i have done is forbidden in ANSI C.
: Sorry for the long delay, been quite busy lately.
: P.J. Plauger in his excellent "The Standard C Library" spells this in
: plain English (p. 209):
: You must not write a type T that widens when passed as an
: argument. Replace `float' with `double'. Replace `char',
: `signed char', `unsigned char', `short' and `unsigned short' with
: either `int' or `unsigned int'...
: > Why does the djgpp compiler does not warn me, even if have
: > used switches like -pedantic -ansi -Wall and so on ?
: I don't know how easy it is for a compiler to detect such problems. In
: any case, this should be reported to the appropriate GNU newsgroup, since
: DJGPP doesn't change the way the GNU C compiler works.
Well, even though it is undefined by ANSI-C, it works with basically every
vararg implementation (including normal gcc/unix and djgpp) since they handle
smaller sized parameters with roundup. The problem that Rainer has comes
from the parameter _before_ the vararg arguments (which I would guess can
be any type with ANSI) due to an inconsistency of the stdarg.h from djgpp
and the currect gcc. See either my previous posts or the bug report #85 (I
think).
bye, Alexander
--
Alexander Lehmann, | "On the Internet,
alex AT hal DOT rhein-main DOT de (plain, MIME, NeXT) | nobody knows
lehmann AT mathematik DOT th-darmstadt DOT de (plain) | you're a dog."
!!CHANGED!! <URL:http://www.mathematik.th-darmstadt.de/~alexlehm/>
- Raw text -