stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: MSVC8 CRT "Secure Template Overloads" feature and stdcxx
Date Wed, 13 Jun 2007 17:39:56 GMT
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Martin Sebor [mailto:sebor@roguewave.com] 
>> 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.

Btw., since you're working on these tests, a useful enhancement
(optimization) would be to test all the declarations in the whole
header first and only test each function individually if the big
test fails. Doing it this way would dramatically speed up the
configuration process. The trick would be to keep the list of
the functions in the big test in sync with the list used for
the individual little tests. One way to deal with it would be
to generate the big test from the individual list as the first
step and fall back on the current mechanism.

Martin


Mime
View raw message