From owner-freebsd-hackers@FreeBSD.ORG Sun Jun 5 18:54:02 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DA22106566B for ; Sun, 5 Jun 2011 18:54:02 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 112E68FC0A for ; Sun, 5 Jun 2011 18:54:01 +0000 (UTC) Received: by wwc33 with SMTP id 33so3132640wwc.31 for ; Sun, 05 Jun 2011 11:54:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=F3ESePeq4fcKK2OzxtQiJGbLk968/K2RoUqvr99SlcY=; b=vBywaoXQiE8NMTn85g/7eVi7atdHfYOfjRGO2SyaGKJHIxZQ5AFqplDL2uRslR9J5Z QRIoWFoZEZmIFzXnb0rkSzSkDtaCBHQH0m1zSsJuopKu+dZXUo3rwFI36gdKS6x6U+mF 7aRvw0vFkLokICcA0y5Hri6bR01cYGk81Ef/E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=Xn2LVR3TcfpL7NC6gHDSRUBDfhGaImHQIHnGGf6xKJc9Irm1KalRHnZ8hrnBjXsTMQ VdXCMqYF0fSLO/Ix2U2irzjw5att8yHbTtePNNn57bCbIZDbPd7wTqkhJ0PLM8t7PPoo ZUYpKwukw0VIaHZzy4MqHxDIvVCV6PN0VG070= MIME-Version: 1.0 Received: by 10.216.141.1 with SMTP id f1mr4050820wej.35.1307298636998; Sun, 05 Jun 2011 11:30:36 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.216.93.193 with HTTP; Sun, 5 Jun 2011 11:30:36 -0700 (PDT) In-Reply-To: <4DEBC741.1020200@links.org> References: <4DEBC741.1020200@links.org> Date: Sun, 5 Jun 2011 11:30:36 -0700 X-Google-Sender-Auth: hNY62-NM0qVvo1H8Q4zlPF_bj7w Message-ID: From: mdf@FreeBSD.org To: Ben Laurie Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: hackers@freebsd.org Subject: Re: int64_t and printf X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2011 18:54:02 -0000 On Sun, Jun 5, 2011 at 11:13 AM, Ben Laurie wrote: > So, for example int64_t has no printf modifier I am aware of. Likewise > its many friends. The worse option is to use the C99 defines, like PRI64 and PRI64U. The better option is to use %jd / %ju and cast the value to [u]intmax_t. Cheers, matthew > In the past I've handled this by having a define somewhere along the > lines of... > > #if > # define INT_64_T_FMT "%ld" > #else > # define INT_64_T_FMT "%lld" > #endif > > but I have no idea where to put such a thing in FreeBSD. Opinions? Also, > I guess I'd really need to do a modifier rather than a format, for full > generality. > > -- > http://www.apache-ssl.org/ben.html =A0 =A0 =A0 =A0 =A0 http://www.links.o= rg/ > > "There is no limit to what a man can do or how far he can go if he > doesn't mind who gets the credit." - Robert Woodruff > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org= " >