From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6527 invoked by alias); 25 May 2017 01:31:35 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 6518 invoked by uid 89); 25 May 2017 01:31:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=Hx-languages-length:633, H*M:google X-HELO: mail-oi0-f48.google.com Received: from mail-oi0-f48.google.com (HELO mail-oi0-f48.google.com) (209.85.218.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 25 May 2017 01:31:33 +0000 Received: by mail-oi0-f48.google.com with SMTP id w10so264459260oif.0 for ; Wed, 24 May 2017 18:31:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:references:to:subject :user-agent; bh=gVbLZsAYNtwEBtNHOo9vG2mxKEpdaEEOahwC6ZkiuzI=; b=ldvu4OhSR/buoQeFpshTGcTnwwc6MEJfkd7YinIgtJZRt0ovPubw4U71d9LCmvXpcW 8Hl00fpUBJMpf+yTRrqC6MQ4XmfigMIjL9KuAyC5lpMa5W4j5T4ZeSAeWBQ2iJ713Luv u8d+YfuIczRxCK/WBxSG1Tkw1Pdew0rLIiIEmzEy+1ZstFK8eTPSXIb8eUPPIm9ONQ6v ocp+ADzuuQRWD9pzLaDzBwjSobPDReB6o9CrDJSYEkOHukHhRO4brrVbi99CBPGTbFHc Wx3AjVgwh5b9RhVVCMiaUh1SmxFZ9v9fullr6ydRaUDoKl8lsLerZDGt9rHkKculM09i jYuQ== X-Gm-Message-State: AODbwcDeNzQYMxJsN1Vhtaa3Jrpq2BFrRJO7xqrt0Uiw6PJec1kx0Zz6 5lmgL1dLtmZDC5ya X-Received: by 10.157.41.203 with SMTP id g11mr5647634otd.72.1495675895251; Wed, 24 May 2017 18:31:35 -0700 (PDT) Received: from xso ([2605:6000:9fc0:56:813:bad7:424c:e627]) by smtp.gmail.com with ESMTPSA id d65sm2688420oia.17.2017.05.24.18.31.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 May 2017 18:31:34 -0700 (PDT) Message-ID: <592633f6.4436ca0a.dc1a8.58f2@mx.google.com> Date: Thu, 25 May 2017 07:50:00 -0000 From: Steven Penny X-Google-Original-From: Steven Penny References: <592618e3.08179d0a.27b5e.4630@mx.google.com> To: cygwin@cygwin.com Subject: Re: bug in lrint [was: FW: Printing long int in C program under cygwin64] Content-Type: text/plain; charset=utf8; format=flowed User-Agent: Tryst/2.0.1 (github.com/svnpenn/tryst) X-SW-Source: 2017-05/txt/msg00400.txt.bz2 On Wed, 24 May 2017 16:36:03, Steven Penny wrote: > Aren’t both wrong? By definition %i is a signed integer, and size_t is unsigned. > So %zu or %llu would be more correct: > > http://wikipedia.org/wiki/C_data_types > > They all seem to do the job though: Correcting myself. Here is why you cannot use %zi: $ cat alfa.c #define __USE_MINGW_ANSI_STDIO 1 #include int main() { printf("%zi %zu %llu\n", __SIZE_MAX__, __SIZE_MAX__, __SIZE_MAX__); } $ x86_64-w64-mingw32-gcc -o alfa alfa.c $ ./alfa -1 18446744073709551615 18446744073709551615 -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple