From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53528 invoked by alias); 24 May 2017 23:36:04 -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 53512 invoked by uid 89); 24 May 2017 23:36:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: =?ISO-8859-1?Q?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=UD:wikipedia.org, aren, aren=e2, H*UA:github.com?= X-HELO: mail-oi0-f41.google.com Received: from mail-oi0-f41.google.com (HELO mail-oi0-f41.google.com) (209.85.218.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 24 May 2017 23:36:02 +0000 Received: by mail-oi0-f41.google.com with SMTP id b204so261664999oii.1 for ; Wed, 24 May 2017 16:36:05 -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:subject:to:references :user-agent; bh=XbsS6Aunl0kFKuxZ/7LSeX+JJIlExfnKpmcDG2mK2sU=; b=aIdlVzNfmHlIax7SK2Be04MtjMVnGpDbHfV0/0Vozoicin1jfJk20vttfZMyRNaLPo mJx6prOU8tF2wVLj/NbRiORtPzbOLHWDz01yilbgioeL2cYy18nhZiNd/mqcYvHoldQj bSs057cirs64BHyQBcl0Nb+GMqLvfOMgHuljAJmTNvgvuQds5St3riMbO6vVzKCO0MZt 5VZehqFpW384xwmDuW2JZK1LqJWJAeSvPXr9mdqISoJiqHFyQIJTmSfClKDtnnrdtB/7 jFh3SipVXgEjrSLHz6+/Ta0uEETkSoB0z03WgfShx2Mffoln+L1kZ+W1v+dq6+IxM7rz Dq2g== X-Gm-Message-State: AODbwcAqitoIteK1Fh6SVcCXJF/dMQo6cfFAyPYEUCp7lT0oySPQjYln c3AOrWz/KL754wHh X-Received: by 10.157.61.180 with SMTP id l49mr6548400otc.80.1495668964419; Wed, 24 May 2017 16:36:04 -0700 (PDT) Received: from nlj ([2605:6000:9fc0:56:813:bad7:424c:e627]) by smtp.gmail.com with ESMTPSA id i8sm2530247ota.3.2017.05.24.16.36.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 May 2017 16:36:03 -0700 (PDT) Message-ID: <592618e3.08179d0a.27b5e.4630@mx.google.com> Date: Thu, 25 May 2017 01:31:00 -0000 From: Steven Penny X-Google-Original-From: Steven Penny Subject: Re: bug in lrint [was: FW: Printing long int in C program under cygwin64] To: cygwin@cygwin.com References: Content-Type: text/plain; charset=utf8; format=flowed User-Agent: Tryst/2.0.1 (github.com/svnpenn/tryst) X-SW-Source: 2017-05/txt/msg00399.txt.bz2 On Wed, 24 May 2017 07:33:27, Eric Blake wrote: > Buggy. size_t should be printed with %zi, not %i (since size_t and int > are not necessarily the same type). 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: $ cat alfa.c #define __USE_MINGW_ANSI_STDIO 1 #include int main() { size_t bravo = 1; printf("%zi %zu %llu\n", bravo, bravo, bravo); } $ x86_64-w64-mingw32-gcc -o alfa alfa.c $ ./alfa 1 1 1 -- 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