From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,daa9a948bbcdbea6 X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-01-15 12:33:40 PST Path: gmd.de!newsserver.jvnc.net!darwin.sura.net!howland.reston.ans.net!vixen.cso.uiuc.edu!uwm.edu!caen!batcomputer!cornell!newsstand.cit.cornell.edu!lns598.lns.cornell.edu!dsr From: dsr@lns598.tn.cornell.edu (Daniel S. Riley) Newsgroups: comp.unix.osf.osf1 Subject: Re: stdarg's unpredictable Date: 15 Jan 1994 19:58:32 GMT Organization: Wilson Lab, Cornell U., Ithaca, NY 14853 Message-ID: References: <1994Jan14.164003.57216@kuhub.cc.ukans.edu> NNTP-Posting-Host: lns100.lns.cornell.edu 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 [...] 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