Following source code doesn't compile using a 64-bit GNU compiler (it
works fine using a 32-bit compiler);

# 1 "va_list_bug.cc"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "va_list_bug.cc"
# 1 "/usr/lib/gcc-lib/x86_64-linux/3.3.5/include/stdarg.h" 1 3 4
# 43 "/usr/lib/gcc-lib/x86_64-linux/3.3.5/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 105 "/usr/lib/gcc-lib/x86_64-linux/3.3.5/include/stdarg.h" 3 4
typedef __gnuc_va_list va_list;
# 2 "va_list_bug.cc" 2

void myfunc (va_list param);

char buffer[128];

int main(int argc, char *argv[])
{
        myfunc(buffer);
}


gcc -v:
Reading specs from /usr/lib/gcc-lib/x86_64-linux/3.3.5/specs
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared
--enable-__cxa_atexit --with-system-zlib --enable-nls
--without-included-gettext --enable-clocale=gnu --enable-debug
--enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc
--disable-multilib x86_64-linux
Thread model: posix
gcc version 3.3.5 (Debian 1:3.3.5-13)

commandline, that produces the error:
g++ -c va_list_bug.cc

compiler error message:
va_list_bug.cc: In function `int main(int, char**)':
va_list_bug.cc:9: error: cannot convert `char*' to `__va_list_tag*' for
   argument `1' to `void myfunc(__va_list_tag*)'
wh /tmp $ g++ -c va_list_bug.cc -save-temps
va_list_bug.cc: In function `int main(int, char**)':
va_list_bug.cc:9: error: cannot convert `char*' to `__va_list_tag*' for
   argument `1' to `void myfunc(__va_list_tag*)'


-- 
           Summary: problem with va_list function-parameter
           Product: gcc
           Version: 3.3.5
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: wh at ciphirelabs dot com


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

Reply via email to