On X86-64, the following code demonstrates how passing a long double as a fixed argument causes corruption of the following variable arguments.
#include <stdio.h> #include <assert.h> #include <stdarg.h> void test(int a, int b, int c, int d, int e, int f, int g, long double h, ...) { int i; va_list ap; va_start(ap, h); i = va_arg(ap, int); printf("Got %d, expected %d\n", i, 123456789); va_end(ap); } int main() { test(0, 0, 0, 0, 0, 0, 0, (long double)0.0, (int)123456789); return 0; } -- Summary: Bug in argument passing of long double Product: gcc Version: 4.4.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pdox at alum dot mit dot edu GCC build triplet: x86_64-linux-gnu GCC host triplet: x86_64-linux-gnu GCC target triplet: x86_64-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44942