This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: second parameter of `va_start' not last named argument
- From: corey taylor <corey dot taylor at gmail dot com>
- To: Antonio Coralles <noche dot suapie at reflex dot at>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 25 Mar 2005 13:43:17 -0600
- Subject: Re: second parameter of `va_start' not last named argument
- References: <4243670A.1010300@reflex.at>
- Reply-to: corey taylor <corey dot taylor at gmail dot com>
Exactly, you know the number and so you provide the value to va_start.
The user calling foo does not provide this.
corey
On Fri, 25 Mar 2005 02:19:06 +0100, Antonio Coralles
<noche.suapie@reflex.at> wrote:
> is there a way to prevent this gcc warning?
> in a code similar to
>
> void foo(const std::string& format, ...);
>
> i determine the neccessary number of arguments by counting the
> occurences of "%s" in format,
> similar to printf. therefore, there is no need for the caller to pass
> the number of arguments as a second
> argument.
>
> thanks
> Antonio
>