incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Farid Zaripov" <Farid_Zari...@epam.com>
Subject RE: MSVC8 CRT "Secure Template Overloads" feature and stdcxx
Date Wed, 13 Jun 2007 17:29:04 GMT
> -----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.

  Read the comment from <stdarg.h>:

/* Define va_list, if desired, from __gnuc_va_list. */
/* We deliberately do not define va_list when called from
   stdio.h, because ANSI C says that stdio.h is not supposed to define
   va_list.  stdio.h needs to have access to that data type, 
   but must not use that name.  It should use the name __gnuc_va_list,
   which is safe because it is reserved for the implementation.  */

Farid.

Mime
View raw message