>va_arg doesn't work correctly in functions which have been inlined. Either
>the compiler should reject functions using va_arg as candidates for
[quoted text clipped - 38 lines]
>installation and won't uninstall or reinstall no matter what I do) or VC++ 6
>because I don't have it installed.

Signature
Doug Harrison
Microsoft MVP - Visual C++
> >va_arg doesn't work correctly in functions which have been inlined. Either
> >the compiler should reject functions using va_arg as candidates for
[quoted text clipped - 43 lines]
>
> int TestVararg(int intFirst, ...)
That works okay for this scenario, so I guess the auto-inlining just looks
for '...' in the argument list rather than being a bit more clever and
looking at the implementation of the function.
Unfortunately, the function in our application is overloaded with many
different argument counts so we can't use '...'. :-(
Varargs was useful because it meant that we didn't have to implement every
version manually. I've disabled inlining now, so hopefully that is the only
scenario that causes problems.
> P.S. A better group for VC.NET questions is:
>
> microsoft.public.dotnet.languages.vc
Thanks. I was wondering why microsoft.public.vsnet.development didn't exist
and what the equivalent was. :-)
Regards,
Aaron Queenan.
Doug Harrison [MVP] - 13 Aug 2003 20:52 GMT
>That works okay for this scenario, so I guess the auto-inlining just looks
>for '...' in the argument list rather than being a bit more clever and
[quoted text clipped - 6 lines]
>version manually. I've disabled inlining now, so hopefully that is the only
>scenario that causes problems.
If at all possible, I'd fix the code. It's incorrect to use va_start on a
parameter which does not immediately precede the ellipsis. I know your
example was probably very much simplified, and I'm having a hard time
visualizing a more realistic application of this, so I can't make any
specific suggestions without seeing more code.

Signature
Doug Harrison
Microsoft MVP - Visual C++