From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129238 invoked by alias); 27 Apr 2015 17:45:27 -0000 Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org Received: (qmail 129122 invoked by uid 89); 27 Apr 2015 17:45:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wg0-f47.google.com Received: from mail-wg0-f47.google.com (HELO mail-wg0-f47.google.com) (74.125.82.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 27 Apr 2015 17:45:23 +0000 Received: by wgin8 with SMTP id n8so124205633wgi.0 for ; Mon, 27 Apr 2015 10:45:20 -0700 (PDT) X-Received: by 10.180.78.199 with SMTP id d7mr22459688wix.94.1430156720358; Mon, 27 Apr 2015 10:45:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.33.135 with HTTP; Mon, 27 Apr 2015 10:45:00 -0700 (PDT) In-Reply-To: References: <553E6D2E.7060403@redhat.com> From: Bruce Korb Date: Mon, 27 Apr 2015 17:45:00 -0000 Message-ID: Subject: Re: pass by value and also snprintf() To: Richard Henderson Cc: libffi-discuss@sourceware.org Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015/txt/msg00067.txt.bz2 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 wrote: > Like this then: > > > #include > #include > #include > > #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; >