From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,e7ad7ed3bb0181b9,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-12-22 04:54:50 PST Newsgroups: comp.unix.osf.osf1 Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!udel!gatech!howland.reston.ans.net!Germany.EU.net!news.dfn.de!zeus.rbi.informatik.uni-frankfurt.de!terra.wiwi.uni-frankfurt.de!news.th-darmstadt.de!zib-berlin.de!math.fu-berlin.de!axp3.physik.fu-berlin.de!nicoles From: nicoles@axp3.physik.fu-berlin.de (Ivonne Nicolescu) Subject: Possible PROBLEM with the cc compiler Message-ID: Summary: we do have a problem Keywords: va_start,va_arg Sender: news@math.fu-berlin.de (Math Department) Nntp-Posting-Host: axp3.physik.fu-berlin.de Organization: Free University of Berlin, Germany Date: Thu, 22 Dec 1994 12:54:50 GMT I have a problem with the variable argument list which don't work properly with cc but does it with gcc. Example: ... pr("s", "Test !"); ... void pr(char *fmt, ...) { va_list val; char *ch; va_start(val, fmt); if (*fmt == 's') { ch = va_arg(val, char *); printf("\n %s ", ch); } va_end(val); } The string "Test !" is never printed and the pointer I get from va_arg(val, char *) is NULL ! Any suggestion is welcome. Merry Christmas, please answer to: toerring@omega.physik.fu-berlin.de