Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org, Mark Kettenis <kettenis@gnu.org>
Subject: Re: [patch] [mingw] Fix "%lld" compilation error
Date: Fri, 15 Jun 2012 15:57:00 -0000	[thread overview]
Message-ID: <20120615155716.GQ18729@adacore.com> (raw)
In-Reply-To: <20120615154407.GA30377@host2.jankratochvil.net>

> 2012-06-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
> 
> 	* 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 <stdlib.h>
>  #include <string.h>
> @@ -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


  reply	other threads:[~2012-06-15 15:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-15 15:44 Jan Kratochvil
2012-06-15 15:57 ` Joel Brobecker [this message]
2012-06-15 16:49   ` [patchv2] " Jan Kratochvil
2012-06-28 17:09     ` [commit] " Jan Kratochvil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120615155716.GQ18729@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=kettenis@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox