From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25282 invoked by alias); 15 Jun 2012 15:57:41 -0000 Received: (qmail 25268 invoked by uid 22791); 15 Jun 2012 15:57:40 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 15 Jun 2012 15:57:21 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 526861C723D; Fri, 15 Jun 2012 11:57:20 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id j9AMkRCyZK8j; Fri, 15 Jun 2012 11:57:20 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id E06821C7237; Fri, 15 Jun 2012 11:57:19 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 3D335145616; Fri, 15 Jun 2012 08:57:16 -0700 (PDT) Date: Fri, 15 Jun 2012 15:57:00 -0000 From: Joel Brobecker To: Jan Kratochvil Cc: gdb-patches@sourceware.org, Mark Kettenis Subject: Re: [patch] [mingw] Fix "%lld" compilation error Message-ID: <20120615155716.GQ18729@adacore.com> References: <20120615154407.GA30377@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120615154407.GA30377@host2.jankratochvil.net> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-06/txt/msg00510.txt.bz2 > 2012-06-15 Jan Kratochvil > > * common/buffer.c: Include inttypes.h. > (buffer_xml_printf): Use PRIdMAX, PRIuMAX, PRIxMAX and PRIoMAX. I vaguely remember us not necessarily wanting to use some of those, but I don't remember the details. Perhaps Mark remembers? It seems that gnulib might be dealing with portability issues for us... > --- ./gdb/common/buffer.c-orig 2012-05-22 17:55:30.000000000 +0200 > +++ ./gdb/common/buffer.c 2012-06-15 17:38:21.255770838 +0200 > @@ -25,6 +25,7 @@ > > #include "xml-utils.h" > #include "buffer.h" > +#include "inttypes.h" > > #include > #include > @@ -139,16 +140,16 @@ buffer_xml_printf (struct buffer *buffer > switch (*f) > { > case 'd': > - sprintf (str, "%lld", va_arg (ap, long long)); > + sprintf (str, "%" PRIdMAX, va_arg (ap, long long)); > break; > case 'u': > - sprintf (str, "%llu", va_arg (ap, unsigned long long)); > + sprintf (str, "%" PRIuMAX, va_arg (ap, unsigned long long)); > break; > case 'x': > - sprintf (str, "%llx", va_arg (ap, unsigned long long)); > + sprintf (str, "%" PRIxMAX, va_arg (ap, unsigned long long)); > break; > case 'o': > - sprintf (str, "%llo", va_arg (ap, unsigned long long)); > + sprintf (str, "%" PRIoMAX, va_arg (ap, unsigned long long)); > break; > default: > str = 0; -- Joel