X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:reply-to:to:message-id:subject :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=SaV6hFIsCo0u3KpDRrg/TYm1U6gUhZKE6w4WUOhd1uCw+JZL/3Bm6 4aZW9nzQf7neEwnqYSxK/OfBAFIotujYmIGh5sxuJ9y/pq52IG+YvtEXHtx9os3+ 2FIvX/pEAyUihfhZ8ycjqH4tgJbAH6UV+MYrWTOaUWtVCEIBUnv6gc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:reply-to:to:message-id:subject :mime-version:content-type:content-transfer-encoding; s=default; bh=B9ZAdi68TwlA3ErXSWFtHaVnztk=; b=Uh1GV15Wj5RHvYfOWXH6fTM4It4p MWxTGSQJl0gPFm1XchL3PoLc3hL48TABNM8zd385/z/kMyx3YGkBw6z3GLJQtteM dXW70mPT8r9TiHl42CQgw4nHjGwwau42HgNIYhBsD0AaZOL6URTNDXDWnmt+kcLL CQS5d66N/MBUpjE= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,REPTO_QUOTE_YAHOO,SPF_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: nm18-vm3.bullet.mail.ne1.yahoo.com Date: Mon, 27 Apr 2015 22:52:26 +0000 (UTC) From: "Cary R." Reply-To: "Cary R." To: The Cygwin Mailing List Message-ID: <261055273.5586453.1430175146814.JavaMail.yahoo@mail.yahoo.com> Subject: Incorrect compile warning, possible bug in inttypes.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id t3RMrcTJ015474 The following code: #include #include int main() { int32_t ival = 1; uint32_t uval = 2; printf("int = %"PRId32", uint = %"PRIu32".\n", ival, uval); return 0; } when compiled with either gcc or clang on a 32-bit system and with the -Wall flag produces the following warnings: tmp.c: In function ‘main’: tmp.c:9:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘int32_t’ [-Wformat=] printf("int = %"PRId32", uint = %"PRIu32".\n", ival, uval); ^ tmp.c:9:5: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint32_t’ [-Wformat=] tmp.c:9:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘int32_t’ [-Wformat=] tmp.c:9:5: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint32_t’ [-Wformat=] I'm not sure why the double report for this, but both gcc and clang do the same thing. This looks to be an issue that is generated because a long is 32 bits on a 32-bit system and in inttypes.h __have_long32 is likely defined and that is forcing the use of the 'l' formats when that is incorrect for at least these two 32 bit types. -- 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