This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: pass by value and also snprintf()
- From: Bruce Korb <bruce dot korb at gmail dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: libffi-discuss at sourceware dot org
- Date: Mon, 27 Apr 2015 10:45:00 -0700
- Subject: Re: pass by value and also snprintf()
- Authentication-results: sourceware.org; auth=none
- References: <CAKRnqNK1D9Wp3uedW62uVk-5FCfzGgDd0xOA2W9qMQeizV1TSw at mail dot gmail dot com> <553E6D2E dot 7060403 at redhat dot com> <CAKRnqNJtEj_VvXNrF=QXteJAwAYmKZ3K1PAxtb35hY43Nr0ezw at mail dot gmail dot com>
s/sprintf/snprintf/ -- I had it right in the original code, and with
that fix it still seg faults.
On Mon, Apr 27, 2015 at 10:37 AM, Bruce Korb <bruce.korb@gmail.com> wrote:
> Like this then:
>
>
> #include <stdint.h>
> #include <stdio.h>
> #include <ffi.h>
>
> #define UCONST(_p) ((void *)(uintptr_t)_p)
>
> int
> main(int argc, char ** argv)
> {
> char buffer[0x1000];
> size_t bufsz = sizeof(buffer);
> char const fmt[] = "Allocated sblock_id=%d for band_id=%d\n";
> int32_t sblock = 1;
> int32_t band = 1;
> void * fn = sprintf;
>