From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4233 invoked by alias); 15 Jun 2012 16:49:30 -0000 Received: (qmail 4222 invoked by uid 22791); 15 Jun 2012 16:49:27 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 15 Jun 2012 16:49:13 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5FGmvOT003016 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 15 Jun 2012 12:48:58 -0400 Received: from host2.jankratochvil.net (ovpn-116-33.ams2.redhat.com [10.36.116.33]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q5FGmrm9020460 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 15 Jun 2012 12:48:56 -0400 Date: Fri, 15 Jun 2012 16:49:00 -0000 From: Jan Kratochvil To: Joel Brobecker Cc: gdb-patches@sourceware.org, Mark Kettenis Subject: [patchv2] [mingw] Fix "%lld" compilation error Message-ID: <20120615164852.GA2010@host2.jankratochvil.net> References: <20120615154407.GA30377@host2.jankratochvil.net> <20120615155716.GQ18729@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120615155716.GQ18729@adacore.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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/msg00512.txt.bz2 On Fri, 15 Jun 2012 17:57:16 +0200, Joel Brobecker wrote: > > 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... Update, the previous patch broke x86_64 GNU/Linux build. Thanks, Jan gdb/ 2012-06-15 Jan Kratochvil * common/buffer.c: Include inttypes.h and stdint.h. (buffer_xml_printf): Use PRId64, PRIu64, PRIx64 and PRIo64. --- a/gdb/common/buffer.c +++ b/gdb/common/buffer.c @@ -25,10 +25,12 @@ #include "xml-utils.h" #include "buffer.h" +#include "inttypes.h" #include #include #include +#include void buffer_grow (struct buffer *buffer, const char *data, size_t size) @@ -139,16 +141,20 @@ buffer_xml_printf (struct buffer *buffer, const char *format, ...) switch (*f) { case 'd': - sprintf (str, "%lld", va_arg (ap, long long)); + sprintf (str, "%" PRId64, + (int64_t) va_arg (ap, long long)); break; case 'u': - sprintf (str, "%llu", va_arg (ap, unsigned long long)); + sprintf (str, "%" PRIu64, + (uint64_t) va_arg (ap, unsigned long long)); break; case 'x': - sprintf (str, "%llx", va_arg (ap, unsigned long long)); + sprintf (str, "%" PRIx64, + (uint64_t) va_arg (ap, unsigned long long)); break; case 'o': - sprintf (str, "%llo", va_arg (ap, unsigned long long)); + sprintf (str, "%" PRIo64, + (uint64_t) va_arg (ap, unsigned long long)); break; default: str = 0;