From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 125561F5AE for ; Tue, 21 Jul 2020 07:56:26 +0000 (UTC) Received: from localhost ([::1]:50380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jxn8T-0000ao-8c for normalperson@yhbt.net; Tue, 21 Jul 2020 03:56:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jxn8P-0000aP-EQ for bug-gnulib@gnu.org; Tue, 21 Jul 2020 03:56:21 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.162]:33354) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jxn8M-0001Dd-GX for bug-gnulib@gnu.org; Tue, 21 Jul 2020 03:56:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1595318175; s=strato-dkim-0002; d=clisp.org; h=Message-ID:Date:Subject:To:From:X-RZG-CLASS-ID:X-RZG-AUTH:From: Subject:Sender; bh=RmtKIJPLVf0eF8DTIAAWBZwhVtbfRdcqX5iw3Rr44XU=; b=kCTwlQMwYU10kq8/xM+4M5994arbIfV99WHNhSehifPSgE9s/ikV6yEbVuvxE0lxUL RAcaphqs/DDPZmQ2M18hl6VUjvsfv848FxUfU/O3T8sYL9Hoq0RfO+XoR6MhSVxpVCPx 6dYvmJNcS+JCFwnHf3ASza6gqOwCvUSOCGZrYColciHsJS+6H9Kz7q7ve1k1tB6uHvSd Xw00oyeqehCaW2fdSvFBqz0Z5sAYps5WR+0dMTZVGv0D4OdPY67AWB0UxNIOLsDMtFd0 tH4YNoTbyodepVESHbfbnTG9gzM3YTd8l0mUNtDubxJ8dbgSeF9rtZs9kNY130G3Ak9v YMDg== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOH6fzxfs=" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 46.10.5 DYNA|AUTH) with ESMTPSA id R03d1aw6L7uEIcJ (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Tue, 21 Jul 2020 09:56:14 +0200 (CEST) From: Bruno Haible To: bug-gnulib@gnu.org Subject: inttypes: Fix PRI*PTR and SCN*PTR on 64-bit native Windows Date: Tue, 21 Jul 2020 09:56:13 +0200 Message-ID: <2485981.z5oBFNaXNf@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-179-generic; KDE/5.18.0; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=81.169.146.162; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/21 03:56:15 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" On 64-bit native Windows, PRIPTR_PREFIX comes out as "l", which produces wrong output of intptr_t values through *printf. It should be "ll" instead. 2020-07-21 Bruno Haible inttypes: Fix PRI*PTR and SCN*PTR on 64-bit native Windows. * m4/inttypes.m4 (gl_INTTYPES_PRI_SCN): On 64-bit native Windows, make sure PRIPTR_PREFIX is defined to "ll", not "l". diff --git a/m4/inttypes.m4 b/m4/inttypes.m4 index 224d0cd..f9f5f86 100644 --- a/m4/inttypes.m4 +++ b/m4/inttypes.m4 @@ -1,4 +1,4 @@ -# inttypes.m4 serial 29 +# inttypes.m4 serial 30 dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -39,8 +39,17 @@ AC_DEFUN([gl_INTTYPES_PRI_SCN], PRIPTR_PREFIX= if test -n "$STDINT_H"; then - dnl Using the gnulib . It always defines intptr_t to 'long'. - PRIPTR_PREFIX='"l"' + dnl Using the gnulib . It defines intptr_t to 'long' or + dnl 'long long', depending on _WIN64. + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #ifdef _WIN64 + LLP64 + #endif + ]]), + ], + [PRIPTR_PREFIX='"l"'], + [PRIPTR_PREFIX='"ll"']) else dnl Using the system's . for glpfx in '' l ll I64; do