Compilation problem in copying a va_list variable on a 64-bit machine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I am writing a program that needs to copy a variable of type
__builtin_va_list. Copying this variable works correctly with gcc-4.1 on
a 32-bit machine, but it reports a compilation error on a 64-bit
machine. The program is:

#include <stdarg.h>

int main()
{
  va_list l1;
  va_list l2;

  l1 = l2;

  return 0;
}

There is no error on a 32-bit machine with gcc-4.1:

$ gcc-4.1 --version
gcc-4.1 (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
$ gcc-4.1 t.c



The error on a 64-bit machine with gcc-4.1 is:

$ gcc-4.1 --version
gcc-4.1 (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
$ gcc-4.1 t.c
t.c: In function 'main':
t.c:8: error: incompatible types in assignment



The error on a 64-bit machine with gcc-4.4 is:
$ gcc-4.4 --version
gcc-4.4 (Ubuntu 4.4.1-4ubuntu9) 4.4.1
$ gcc-4.4 t.c
t.c: In function 'main':
t.c:8: error: incompatible types when assigning to type 'va_list' from type 'struct __va_list_tag *'



Is this a bug in gcc on 64-bit machines ? What is the appropriate way of
copying a variable of type va_list that needs to be preserved ?

Thanks,
Kristis

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux