From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sz6XG-0006DN-Mw for qemu-devel@nongnu.org; Wed, 08 Aug 2012 09:43:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sz6XB-0003Pc-JF for qemu-devel@nongnu.org; Wed, 08 Aug 2012 09:42:54 -0400 Received: from e4.ny.us.ibm.com ([32.97.182.144]:41232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sz6XB-0003Od-2E for qemu-devel@nongnu.org; Wed, 08 Aug 2012 09:42:49 -0400 Received: from /spool/local by e4.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 8 Aug 2012 09:42:43 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 9CC1AC90071 for ; Wed, 8 Aug 2012 09:40:54 -0400 (EDT) Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q78DeqYW128880 for ; Wed, 8 Aug 2012 09:40:52 -0400 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q78DfkSI022359 for ; Wed, 8 Aug 2012 07:41:46 -0600 Message-ID: <50226C4A.6060303@linux.vnet.ibm.com> Date: Wed, 08 Aug 2012 09:40:26 -0400 From: Corey Bryant MIME-Version: 1.0 References: <1344014889-12390-1-git-send-email-coreyb@linux.vnet.ibm.com> <1344014889-12390-3-git-send-email-coreyb@linux.vnet.ibm.com> <502173AF.9060909@linux.vnet.ibm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 2/6] qapi: Introduce add-fd, remove-fd, query-fdsets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com, libvir-list@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, eblake@redhat.com On 08/08/2012 04:52 AM, Stefan Hajnoczi wrote: > On Tue, Aug 7, 2012 at 8:59 PM, Corey Bryant wrote: >> >> >> On 08/07/2012 02:16 PM, Stefan Hajnoczi wrote: >>> >>> On Fri, Aug 3, 2012 at 6:28 PM, Corey Bryant >>> wrote: >>>> + snprintf(fd_str, sizeof(fd_str), "%ld", fd); >>>> + qerror_report(QERR_FD_NOT_FOUND, fd_str); >>> >>> >>> Why use an fd_str instead of passing an int64_t into the error >>> message? This also assumed sizeof(long) == 8, which isn't true on >>> 32-bit hosts, so %ld should be %"PRId64". >> >> >> Can I pass an int64_t into the message if it takes a string? >> >> I thought int64_t was a long long in 32-bit mode, but perhaps that's not >> always the case? > > The PRId64 format specifier macro from the C standard hides this so > you can pass int64_t values to printf()-style functions in a portable > way. > > Stefan > Thanks, I'll use PRId64. -- Regards, Corey