> The warning I get is as follows:
>
[quoted text clipped - 18 lines]
>
> }
The __va_start looks very much like an internal function, probably of a
certain C library (GNU libc maybe?), that you as a user shouldn't use.
Here's some example of vfprintf(), I think your vsprintf should be
similar:
int some_func(char *format, ...)
{
va_list args;
va_start(args, format);
vfprintf(stderr, format, args);
va_end(args);
return bla;
}
Basically you can use the list as a va_list, and you have to wrap its
use between va_start and va_end.
HTH
(btw, the stdarg header is alright)
David C. - 28 Nov 2006 16:01 GMT
>> The warning I get is as follows:
>>
[quoted text clipped - 35 lines]
> Basically you can use the list as a va_list, and you have to wrap its
> use between va_start and va_end.
I'd just like to add that the double-underscore (at the beginning of
__va_start) should be a hint to you that the code is using something it
shouldn't be using.
The C and C++ language specs reserve all double-underscore symbols for
internal use by the compiler and it's standard libraries. If you use
one, you should be aware that it is internal, proprietary, not portable,
and subject to change without notice in future releases of the compiler.
(Similarly, you should never use a double-underscore in any function you
write, because it might conflict with an internal compiler-symbol now or
in the future.)
-- David
Phil Rogers - 28 Nov 2006 20:17 GMT
> > The warning I get is as follows:
> >
[quoted text clipped - 39 lines]
>
> (btw, the stdarg header is alright)
Thanks for the tip. The va_start call looks like a much better way
of doing things than what I have been doing all this time. I'm not sure
what past example the __va_start usage originally came from
but I found it at least 10-15 years ago and have been using it all
this time simply because it worked and worked well to accomplish
the task I needed. It was probably somebody's CW or MPW shortcut
that really needs to be put into the proper form for continued use.
I will give the va_start() function a try right now. If you hear
no additional reply from me you can assume that it worked OK.
Thanks again.
PCR
--
>Can anybody tell me where __va_start is declared in the Unix headers
>used by XCode
It isn't. __va_start (as indicated by the leading "___") is internal
to a compiler suite. It won't work on any other compiler suite
(except by chance).
>I am in the process of porting all my CW code over to XCode
There's your problem.
Just guessing: you probably want to use the standard va_start() macro.

Signature
dhs spencer@panix.com