1/* Undefined behavior from a call to va_arg with a type other than 2 that of the argument passed (in particular, with a type such as 3 "float" that can never be the type of an argument passed through 4 "...") does not appear until after the va_list expression is 5 evaluated. PR 38483. */ 6/* Origin: Joseph Myers <joseph@codesourcery.com> */ 7 8#include <stdarg.h> 9 10extern void exit (int); 11extern void abort (void); 12 13va_list ap; 14float f; 15 16va_list * 17foo (void) 18{ 19 exit (0); 20 return ≈ 21} 22 23void 24bar (int i, ...) 25{ 26 va_start (ap, i); 27 f = va_arg (*foo (), float); 28 va_end (ap); 29} 30 31int 32main (void) 33{ 34 bar (1, 0); 35 abort (); 36} 37