From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 97B113858004 for ; Mon, 22 Mar 2021 10:36:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 97B113858004 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-48-Gz4YjniOO-KexLaiwCVPAw-1; Mon, 22 Mar 2021 06:36:50 -0400 X-MC-Unique: Gz4YjniOO-KexLaiwCVPAw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EA87F8189C6; Mon, 22 Mar 2021 10:36:49 +0000 (UTC) Received: from zarquon.pink (unknown [10.33.36.191]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0529970911; Mon, 22 Mar 2021 10:36:48 +0000 (UTC) Subject: Re: How to call 'printf' using libffi? To: Anthony Green Cc: libffi-discuss References: <00aed94e-6f76-f6d7-9878-a3eb50dce543@163.com> <7c8729d8-d10e-cdb8-5518-e2f82ccbe141@redhat.com> <71f0c5ea-e3b7-176e-a0a1-29dceeff69b9@redhat.com> From: Andrew Haley Message-ID: <7f64d879-4b29-1d27-47c6-a942f1a35388@redhat.com> Date: Mon, 22 Mar 2021 10:36:48 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libffi-discuss@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libffi-discuss mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 10:36:56 -0000 On 3/20/21 11:56 PM, Anthony Green wrote: > It's worth noting that JNA, one of libffi's big users, does the > float-to-double promotion at their layer. > https://github.com/java-native-access/jna/issues/463 > > Ruby's FFI does the same thing: > https://github.com/ffi/ffi/blob/6d14c0a9107c0d5febb3bf92a60d2581e768fa2f/ext/ffi_c/Variadic.c > > This is making me feel more comfortable about returning an error on float > varargs. (I've change my mind about aborting) That souns right. libffi is the lowest-level layer, after all. -- Andrew Haley (he/him) Java Platform Lead Engineer Red Hat UK Ltd. https://keybase.io/andrewhaley EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671