delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/17/00:18:58

Xref: news2.mv.net comp.os.msdos.djgpp:3935
From: lehmann AT mathematik DOT th-darmstadt DOT de (Alexander Lehmann)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: vararg the second
Date: 16 May 1996 23:59:24 GMT
Organization: Technische Hochschule Darmstadt
Lines: 39
Message-ID: <4ngfgs$1rja@rs18.hrz.th-darmstadt.de>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 960516153443 DOT 5771B-100000 AT is>
NNTP-Posting-Host: fb0401.mathematik.th-darmstadt.de
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


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