Re: Variable arg function question [SOLVED]

2008-05-04 Thread Unga
--- Roland Smith <[EMAIL PROTECTED]> wrote: > On Sun, May 04, 2008 at 08:34:30AM -0700, Unga > wrote: > > > > --- Roland Smith <[EMAIL PROTECTED]> wrote: > > > > > On Sun, May 04, 2008 at 07:02:36AM -0700, > Patrick > > > Clochesy wrote: > > > > What about using a macro (...) in front of the >

Re: Variable arg function question

2008-05-04 Thread Roland Smith
On Sun, May 04, 2008 at 08:34:30AM -0700, Unga wrote: > > --- Roland Smith <[EMAIL PROTECTED]> wrote: > > > On Sun, May 04, 2008 at 07:02:36AM -0700, Patrick > > Clochesy wrote: > > > What about using a macro (...) in front of the > > function to csll it which > > > passes __VARARGS__, NULL to e

Re: Variable arg function question

2008-05-04 Thread Unga
--- Roland Smith <[EMAIL PROTECTED]> wrote: > On Sun, May 04, 2008 at 07:02:36AM -0700, Patrick > Clochesy wrote: > > What about using a macro (...) in front of the > function to csll it which > > passes __VARARGS__, NULL to ensure there is always > a trailing NULL? I think > > this would at le

Re: Variable arg function question

2008-05-04 Thread Roland Smith
On Sun, May 04, 2008 at 07:02:36AM -0700, Patrick Clochesy wrote: > What about using a macro (...) in front of the function to csll it which > passes __VARARGS__, NULL to ensure there is always a trailing NULL? I think > this would at least work in GCC... Can' test on my phone though. That's a g

Re: Variable arg function question

2008-05-04 Thread Patrick Clochesy
What about using a macro (...) in front of the function to csll it which passes __VARARGS__, NULL to ensure there is always a trailing NULL? I think this would at least work in GCC... Can' test on my phone though. -Patrick On May 4, 2008, at 4:42 AM, Peter Boosten <[EMAIL PROTECTED]> wrote

Re: Variable arg function question

2008-05-04 Thread Peter Boosten
Unga wrote: Hi all I need to implement a variable argument function in C. The number of args are not known but the type is known, all are strings. Unfortunately va_arg() [stdarg(3)] does not return NULL or any other suitable value after processing the arg list, it just simply crashes once the a

Re: Variable arg function question

2008-05-04 Thread Roland Smith
On Sun, May 04, 2008 at 04:01:39AM -0700, Unga wrote: > > > Unfortunately va_arg() [stdarg(3)] does not return > > > NULL or any other suitable value after processing > > the > > > arg list, it just simply crashes once the arg list > > is > > > exhausted. > > > > It is _your_ task to properly clos

Re: Variable arg function question

2008-05-04 Thread Unga
--- Roland Smith <[EMAIL PROTECTED]> wrote: > On Sun, May 04, 2008 at 12:40:43AM -0700, Unga > wrote: > > Hi all > > > > I need to implement a variable argument function > in C. > > The number of args are not known but the type is > > known, all are strings. > > > > Unfortunately va_arg() [stda

Re: Variable arg function question

2008-05-04 Thread Roland Smith
On Sun, May 04, 2008 at 12:40:43AM -0700, Unga wrote: > Hi all > > I need to implement a variable argument function in C. > The number of args are not known but the type is > known, all are strings. > > Unfortunately va_arg() [stdarg(3)] does not return > NULL or any other suitable value after pr

Variable arg function question

2008-05-04 Thread Unga
Hi all I need to implement a variable argument function in C. The number of args are not known but the type is known, all are strings. Unfortunately va_arg() [stdarg(3)] does not return NULL or any other suitable value after processing the arg list, it just simply crashes once the arg list is exh