va_list q

David O'Brien obrien at freebsd.org
Wed Apr 21 21:45:46 PDT 2004


On Wed, Apr 21, 2004 at 09:53:07AM -0700, Marcel Moolenaar wrote:
> On Wed, Apr 21, 2004 at 06:51:27PM +0300, Valentin Nechayev wrote:
> The use of va_arg(args, va_list) works on ia64 (FreeBSD, HP-UX and Linux).
> Given the limited context, I can only suggest that you try to create a
> temporary variable of type va_list and change the offending line to:
> 
> 	va_list tmpvalist = va_arg(args, va_list);
> 	n = vslprintf(buf, buflen + 1, f, tmpvalist);
..snip..
> #include <stdarg.h>
> #include <stdio.h>
> 
> int
> vf2(int count, va_list ap)


Still wrong:

    sledge$ cc arg.c 
    sledge$ ./a.out 
    Segmentation fault (core dumped)

your test program isn't ISO-C compliant.


More information about the freebsd-ia64 mailing list