Subject: Re: bug#36597: 27.0.50; rehash hash tables eagerly in pdumper

From: Paul Eggert <[email-masked]>
Date: Tue, 11 Aug 2020 08:30:23 -0700

On 8/11/20 7:52 AM, Eli Zaretskii wrote:

> It doesn't compile here:
> 
>   pdumper.c: In function 'dump_queue_enqueue':
>   pdumper.c:1012:19: warning: unknown conversion type character 'l' in format [-Wformat=]
>    1012 |       dump_trace ("new object %0*"pI"x weight=%d\n", EMACS_INT_XDIGITS, uobj,
> 	|                   ^~~~~~~~~~~~~~~~
>   In file included from character.h:27,
> 		   from buffer.h:27,
> 		   from pdumper.c:34:
>   lisp.h:108:17: note: format string is defined here
>     108 | #   define pI "ll"

<https://stackoverflow.com/questions/23718110/error-unknown-conversion-type-character-l-in-format-scanning-long-long> 
suggests that this is a problem on MinGW, but pI is supposed to be "I64" on that 
platform, not "ll".

What warnings does your compiler generate for the following?

#include <stdio.h>
int a;
long long b;
int main (void) {
   printf ("x=%0*llx\n", a, b);
   printf ("x=%0*I64x\n", a, b);
   return 0;
}

and what are __MINGW32__, __USE_MINGW_ANSI_STDIO, MINGW_W64, 
__MINGW32_MAJOR_VERSION, __GNUC__, and __GNUC_MINOR__ on your platform?

On my Fedora 31 platform, the above program causes 'gcc -Wall' to say:

t.c: In function ‘main’:
t.c:6:17: warning: unknown conversion type character ‘I’ in format [-Wformat=]
     6 |   printf ("x=%0*I64x\n", a, b);
       |                 ^
t.c:6:11: warning: too many arguments for format [-Wformat-extra-args]
     6 |   printf ("x=%0*I64x\n", a, b);
       |           ^~~~~~~~~~~~~

which is what I'd expect on Fedora.