From: Kristis Makris <mkgnu@mkgnu.net>
To: gcc-help@gcc.gnu.org
Subject: Compilation problem in copying a va_list variable on a 64-bit machine
Date: Tue, 02 Mar 2010 18:03:00 -0000 [thread overview]
Message-ID: <1267552978.3672.41.camel@localhost> (raw)
[-- Attachment #1: Type: text/plain, Size: 1143 bytes --]
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 #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next reply other threads:[~2010-03-02 18:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-02 18:03 Kristis Makris [this message]
2010-03-02 19:12 ` Kevin P. Fleming
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1267552978.3672.41.camel@localhost \
--to=mkgnu@mkgnu.net \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).