Martin Sebor wrote:
Farid Zaripov wrote:
-----Original Message-----
From: Martin Sebor [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 13, 2007 6:24 PM
To: stdcxx-dev@incubator.apache.org
Subject: Re: MSVC8 CRT "Secure Template Overloads" feature and stdcxx

Since va_list can be anything, we need to pass va_list type in function call. We can add function template <class T> get_t () { T t;
return t; } to
the libc_decl.sh and use the followinf declaration: vsprintf((char*)0,0,get_t<va_list>())
in headers.inc.
Wouldn't vsprintf((char*)0,0,va_list()) work?

  I think this should work.

My concern here is with the va_list name: Is it required to be declared in the same header as the functions that use it?

  On gcc 3.4.4/Cygwin the va_list type is not defined in stdio.h.

Right. The C standard requires that <stdarg.h> be #included
before calling vsnprintf(). To do what you want you'd need
to find a way (ideally a general mechanism) to also #include
<stdarg.h> in these tests.

So what's the status of this improvement? I didn't mean to shoot
it down completely, just point out the problem with it on other
platforms. Since this is an MSVC-specific feature it wouldn't be
completely inappropriate to devise an MSVC-specific solution for
it.

Martin

Reply via email to