From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3511 invoked by alias); 2 Mar 2010 18:03:08 -0000 Received: (qmail 3431 invoked by uid 22791); 2 Mar 2010 18:03:07 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from talos.mkgnu.net (HELO talos.mkgnu.net) (216.245.197.45) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 02 Mar 2010 18:03:02 +0000 Received: from [172.16.0.6] ([::ffff:172.16.0.6]) (AUTH: LOGIN mkgnu@mkgnu.net) by talos with esmtp; Tue, 02 Mar 2010 11:07:33 -0700 id 0011011D.4B8D53E6.00007D95 Subject: Compilation problem in copying a va_list variable on a 64-bit machine From: Kristis Makris To: gcc-help@gcc.gnu.org Date: Tue, 02 Mar 2010 18:03:00 -0000 Message-Id: <1267552978.3672.41.camel@localhost> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=_talos-32149-1267553254-0001-2" Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2010-03/txt/msg00025.txt.bz2 This is a MIME-formatted message. If you see this text it means that your E-mail software does not support MIME-formatted messages. --=_talos-32149-1267553254-0001-2 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Content-length: 1096 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 int main() { va_list l1; va_list l2; l1 =3D 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 --=_talos-32149-1267553254-0001-2 Content-Type: application/pgp-signature; name="signature.asc" Content-Transfer-Encoding: 7bit Content-Description: This is a digitally signed message part Content-length: 189 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iD8DBQBLjVLR/KuTDwnYLxERAisoAKCgWjHPqoLwcL25JAfNiwK6clDvnwCfdb+d m5tDp1/8eQTZOPA6INlXLIQ= =qjuE -----END PGP SIGNATURE----- --=_talos-32149-1267553254-0001-2--