🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: dnet.test
Article #72

Re: Removing arguments from va_alist

#72
From: Stefan Stapelberg
Date: Tue, 03 Sep 1991 00:13
31 lines
1374 bytes
Da ich auch mal wieder testen moechte ...  :-)

In article <252@scax04.pki-nbg.philips.de> pla_rwa@pkinbg.UUCP (Robert Wachter LD Tel. 2102 dlds1) writes:
>I have a problem with the varargs. I'm working on a SPARC with the
>standard cc, and want to remove the first argument from a va_alist.
>
>Does anybody know a solution for this problem?

Du musst dazu einfach das erste Argument mit va_arg() verarbeiten, wie in:

    f(va_alist)
    va_dcl
    {
    	va_list args;
    	char *fmt;
    
    	va_start(args);
    	fmt = va_arg(args, char *);
    	...
    
    	func(args);
    	va_end(args);
    }
    
    main() {
    	f("argument_to_delete", "arg2", "arg3", "arg4");
    }

Dieses Beispiel steht uebrigens auch im On-Line-Manual unter vprintf(3).

Gruesse, Stefan
Technical Details
Message-ID: <1636@shiva.systemware.de>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mikros!shiva!stefan
References: <35499@usc.edu> <252@scax04.pki-nbg.philips.de>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1267e7,e5cb37724e2497c
X-Google-Attributes: gid1267e7,public
X-Google-ArrivalTime: 1991-09-03 03:19:50 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mikros!shiva!stefan
From: stefan@shiva.systemware.de (Stefan Stapelberg)
Newsgroups: dnet.test
Subject: Re: Removing arguments from va_alist
Message-ID: <1636@shiva.systemware.de>
Date: 3 Sep 91 00:13:14 GMT
References: <35499@usc.edu> <252@scax04.pki-nbg.philips.de>
Reply-To: stefan@systemware.de (Stefan Stapelberg)
Organization: MIKROS Systemware, Lohr/Germany
Lines: 31