With gcc 3.4.3, I got

[EMAIL PROTECTED] 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
}
[EMAIL PROTECTED] tmp]$ gcc -S a.c
a.c: In function `foo':
a.c:11: incompatible types in assignment
[EMAIL PROTECTED] tmp]$ gcc -S a.c -DWORK

It used to work in gcc 2.96:

[EMAIL PROTECTED] tmp]$ gcc -S a.c
[EMAIL PROTECTED] 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

Reply via email to