delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/08/23:58:31

Date: Thu, 9 May 1996 06:55:52 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: kagel AT dg1 DOT bloomberg DOT com
Cc: wank AT uebemc DOT siemens DOT de, djgpp AT delorie DOT com
Subject: Re: vararg
In-Reply-To: <9605081726.AA03835@quasar.bloomberg.com >
Message-Id: <Pine.SUN.3.91.960509065259.19582A-100000@is>
Mime-Version: 1.0

On Wed, 8 May 1996 kagel AT quasar DOT bloomberg DOT com wrote:

>    void abc(int anzahl, unsigned char abc, ...)
>    {
>     va_list ap;
>     va_start(ap, abc);
>     fg = va_arg(ap, unsigned char);
> 
> 
> The problem is that when you call a variable argument function the arguments
> beyond the list of predefined arguments are all promoted (char and short to
> int, float to double) so you cannot get an unsigned char here.  What you are

In addition to all that's been said on this thread by Art and others, the 
above is explicitly forbidden by ANSI C.

- Raw text -


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