What Compiler version?

Hetz

On 5/8/05, Shachar Shemesh <[EMAIL PROTECTED]> wrote:
> I'm encountering a strange problem, and would like to hear the list's
> ideas on why that would be. The following C++ program:
> 
> > #include <stdarg.h>
> >
> > class test {
> > public:
> >     virtual ~test();
> > };
> >
> > void func( const test &param, ... )
> > {
> >     va_list arg;
> >     va_start( arg, param );
> > }
> 
> When trying to compile, I get the following:
> 
> > test.cc: In function `void func(const test&, ...)':
> > test.cc:11: warning: cannot pass objects of non-POD type `const class
> > test'
> >    through `...'; call will abort at runtime
> > test.cc:11: warning: second parameter of `va_start' not last named
> > argument
> 
> Researching the internet reveals that POD means "Plain Old Data", i.e.
> something that can be copied bit by bit. Obviously, test is not POD.
> What I don't understand is why complain about va_start. va_start only
> needs test in order to know where the first non-specified argument is. I
> could understand if it complained about "va_arg(arg, const test &)", but
> here param is just a place holder, nothing more. All it va_start needs
> to know about it is its size.
> 
> Even stranger is the second warning. If "param" is not the last named
> argument, what is?
> 
>          Shachar
> 
> --
> Shachar Shemesh
> Lingnu Open Source Consulting ltd.
> Have you backed up today's work? http://www.lingnu.com/backup.html
> 
> =================================================================
> To unsubscribe, send mail to [EMAIL PROTECTED] with
> the word "unsubscribe" in the message body, e.g., run the command
> echo unsubscribe | mail [EMAIL PROTECTED]
> 
>

================================================================To unsubscribe, 
send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to