This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/36484] g++ generates code with illegal instruction on Pentium D / x86_64
- From: "vincent at vinc17 dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Jun 2008 15:21:22 -0000
- Subject: [Bug target/36484] g++ generates code with illegal instruction on Pentium D / x86_64
- References: <bug-36484-6373@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #11 from vincent at vinc17 dot org 2008-06-10 15:21 -------
Here's the testcase (I've never used va_list and so on myself, so I hope it is
correct; at least it shows the missing warning problem). With gcc -Wall
-std=c99 -Wc++-compat -pedantic -Wextra, I don't get any warning concerning the
incompatibility with C++.
#include <stdlib.h>
#include <stdarg.h>
typedef enum { ELEM = 17 } en_t;
void vafoo (int i, va_list ap1)
{
en_t x;
x = va_arg (ap1, en_t);
if (x != ELEM)
exit (1);
}
void foo (int i, ...)
{
va_list ap;
va_start (ap, i);
vafoo (i, ap);
va_end (ap);
}
int main ()
{
foo (0, ELEM);
return 0;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36484