From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <97292159612988.tru64-unix-managers.marc@archive.invalid> From: "Narendra Ra\[a\]vi" Date: Mon, 30 Oct 2000 15:58:45 +0000 To: tru64-unix-managers Subject: stdargs.h bug? V4.0F, PK#3 X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=97292159612988 Hi Managers, Have any of you got complaints that the C library implementation of stdarg.h? Is there a patch for this problem in the Standard C library? I have the following program (straight from the man page for stdarg) that dumps core at the fourth argument. #include #include #define MAXargS 100 /* ** execl is called by ** execl(file, arg1, arg2, . . . , (char *) 0); */ void execit(char * file, ...) { va_list ap; char *args[MAXargS]; int argno = 0; va_start(ap, file); for (; (args[argno] = va_arg(ap, char *)) != (char *) 0; argno++) { // prints an invalid fourth address. cout << "addr: " << hex << (void*) args[argno] << endl; // dumps core when printing the fourth argument. Obviously. cout << "arg : " << args[argno] << endl; } va_end(ap); //return (execv(file, args)); } int main() { execit("test", "one", "two", "three"); } -- -- Narendra Ravi Email : narendra@spiff.hr.att.com MT A4-4B27 Phone : 732-420-7792