Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: dsr@lns598.tn.cornell.edu (Daniel S. Riley)
Subject: Re: stdarg's unpredictable
Date: 15 Jan 1994 19:58:32 GMT	[thread overview]
Message-ID: <DSR.94Jan15145832@lns100.lns.cornell.edu> (raw)
In-Reply-To: anh@kuhub.cc.ukans.edu's message of 14 Jan 94 16:40:03 CST


In article <1994Jan14.164003.57216@kuhub.cc.ukans.edu>,
anh@kuhub.cc.ukans.edu writes:

[...]
anh> #include <stdarg.h>
[...]
anh> void test(format)
anh> char *format;
anh> {
anh>   va_list vlist;
[...]

Your function declaration is incorrect--it *must* be

void test(char *format, ...)

See the ANSI C standard, section 6.7.1, "Semantics":

   "If a function that accepts a variable number of arguments is
    defined without a parameter type list that ends with the ellipsis
    notation, the result is undefined."

Fix that, and you should find that it works fine.

--
-Dan Riley                          Internet: dsr@lns598.tn.cornell.edu
-Wilson Lab, Cornell University     HEPNET/SPAN: lns598::dsr (44630::dsr)
	      "Distance means nothing/To me." -Kate Bush


  reply	other threads:[~1994-01-15 19:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-01-14 22:40 stdarg's unpredictable anh
1994-01-15 19:58 ` Daniel S. Riley [this message]
1994-01-17 22:19 ` Gerald Feldman USG
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox