Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Apr 2004 21:45:43 -0700
From:      "David O'Brien" <obrien@freebsd.org>
To:        Marcel Moolenaar <marcel@xcllnt.net>
Cc:        ia64@freebsd.org
Subject:   Re: va_list q
Message-ID:  <20040422044543.GA78422@dragon.nuxi.com>
In-Reply-To: <20040421165307.GB832@ns1.xcllnt.net>
References:  <20040421155127.GS57650@netch.kiev.ua> <20040421165307.GB832@ns1.xcllnt.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040422044543.GA78422>