This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/36484] g++ generates code with illegal instruction on Pentium D / x86_64



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]