This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: second parameter of `va_start' not last named argument


Antonio Coralles <noche.suapie@reflex.at> writes:

> 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.

If you want help, you will need to post a complete test case.
Specifically, how are you calling va_start?  When you call va_start,
you must pass it the last named argument in the function.  Any other
usage is invalid.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]