This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/19113] New: Assigning to va_list var is valid for va_arg calls but not other cases
- From: "hjl at lucon dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Dec 2004 17:54:09 -0000
- Subject: [Bug c/19113] New: Assigning to va_list var is valid for va_arg calls but not other cases
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
With gcc 3.4.3, I got
[hjl@gnu-20 tmp]$ cat a.c
#include <stdarg.h>
void
foo(int l, ...)
{
va_list p,q,r;
va_start(p,l);
#if WORK
q = va_arg(p,va_list);
#else
/* The following code fails */
q = r;
#endif
}
[hjl@gnu-20 tmp]$ gcc -S a.c
a.c: In function `foo':
a.c:11: incompatible types in assignment
[hjl@gnu-20 tmp]$ gcc -S a.c -DWORK
It used to work in gcc 2.96:
[hjl@gnu-6 tmp]$ gcc -S a.c
[hjl@gnu-6 tmp]$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.2 2.96-128.7.2)
Is that a bug or a feature?
--
Summary: Assigning to va_list var is valid for va_arg calls but
not other cases
Product: gcc
Version: 3.4.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hjl at lucon dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19113