This is the mail archive of the gcc-bugs@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]

[Bug c++/11929] New: Cannot obtain variable arguments list in function with last named argument being of non-POD type


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11929

           Summary: Cannot obtain variable arguments list in function with
                    last named argument being of non-POD type
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jbeulich at novell dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

The code

struct s {
	s(int);
};

void test(s o, ...) {
	__builtin_va_list varg;
	__builtin_va_start(varg, o);
}

causes two incorrect warnings:

test.cpp: In function `void test(s, ...)':
test.cpp:7: warning: cannot pass objects of non-POD type `struct s' through 
   `...'; call will abort at runtime
test.cpp:7: warning: second parameter of `va_start' not last named argument

Even if we were not treating warnings as errors the first one is rather
dangerous (despite it not really putting in a call to abort). In any case, the
warnings are pointless because the program no-where passes an object of type s
through ... (except that __builtin_va_start is of type void()(va_list, ...), but
it is neither an actual function, nor should the fact that it is represented
that way affect the user-visible result of the compilation).


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