va__list and pointers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This days I am trying to make a clear function that return a stream. The
problem is that after compile with GCC I can see that GCC miss the
pointers of returned functions in va__list (like a gcc list user said me
(Ingo)).
If the same function is called the last called function return the last
value, is the called functions are different seems to work. For example:

> unsigned char *t_ctime()
> {
> time_t tim;
> tim=time(NULL);
> sleep(1);
> return(ctime(&tim));
> }
??printf("\"1=%s\" \"2=%s\" \"3=%s\" \"4=%s\"",t_ctime(),t_ctime(),t_ctime(),marca());
Values 2,3 = 1.
4!=3,2,1

 For this reason is necessary store the argument returned by functions
in another pre-function execution, Like this:
{
char a[];
char b[];
...
printf(char *fmt, a, b, ...);
}

I see this file:
> /usr/lib/gcc/i386-redhat-linux/3.4.3/include/stdarg.h

but I think that do no exist method to known number of parameters, without search in (char *fmt).
Has GCC any method to make this easy and clear?


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux