From: Richard Dawe Newsgroups: comp.os.msdos.djgpp Subject: Re: stdarg.h problem(s)? Date: Sat, 11 Jan 2003 09:46:00 +0000 Lines: 53 Message-ID: <3E1FE7D8.6490E6C3@phekda.freeserve.co.uk> References: <%kET9.17088$q67 DOT 14211 AT news-binary DOT blueyonder DOT co DOT uk> <1042224128 DOT 205850 AT queeg DOT ludd DOT luth DOT se> <0oNT9.5250$CZ5 DOT 4796 AT news-binary DOT blueyonder DOT co DOT uk> NNTP-Posting-Host: 62.136.44.234 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news8.svr.pol.co.uk 1042280301 2011 62.136.44.234 (11 Jan 2003 10:18:21 GMT) NNTP-Posting-Date: 11 Jan 2003 10:18:21 GMT X-Complaints-To: abuse AT theplanet DOT net X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586) X-Accept-Language: de,fr To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hello. Edd Dawson wrote: [snip] > > Edd Dawson wrote: > > : I am currently running into problems when making functions of an > arbitrary > > : number of arguments in C/C++. > > : I am using DJGPP version 3.2. Here's a reduced version of the code I'm > > : trying to work with: > > > > : //Code starts here: test.c > > : #include > > : #include > > > > : void Warning(char *warningstring, ...) > > : { > > : va_list arg_list; > > : va_start(arg_list, warningstring); > > : printf("WARNING: "); > > : printf(warningstring, arg_list); > > : va_end(arg_list); > > : return; > > : } Try using vprintf instead. Instead of using: printf(warningstring, arg_list); use: vprintf(warningstring, arg_list); Apart from that, the code looks fine. (I haven't tried compiling it.) You may want to look at this info page, if you want gcc to produce printf-style format warnings: info gcc 'c extensions' 'function attributes' [snip] > I think I'll try deleting DJGPP and reinstalling from scratch as I may have > missed something when trying to remove everything from my system last time > around. I don't think you need to go that far. Try reinstalling djdev203. A refreshed version of that was released, which should fix the problem above. > Regardless, my code appears to be incorrect. Can anyone help? Hope that helps. Regards, -- Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]