On Fri, Nov 09, 2018 at 12:04:54PM +0100, Jakub Jelinek wrote:
> On Fri, Nov 09, 2018 at 11:34:48AM +0100, Dominique d'Humières wrote:
> > Bootstrapping r265942 on darwin failed with
> > 
> > In file included from 
> > /Applications/Xcode-6.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/stdio.h:490,
> >                  from ../../../work/libgomp/affinity-fmt.c:28:
> > ../../../work/libgomp/affinity-fmt.c: In function 'gomp_display_affinity':
> > ../../../work/libgomp/affinity-fmt.c:369:17: error: format '%x' expects 
> > argument of type 'unsigned int', but argument 5 has type 'long unsigned 
> > int' -Werror=format=]
> >   369 |   sprintf (buf, "0x%x", (uintptr_t) handle);
> >       |                 ^~~~~~  ~~~~~~~~~~~~~~~~~~
> 
> Weird, the above prints a line which just isn't there, line 369 is:
>                 sprintf (buf, "0x%x", (int) handle);
> not
>                 sprintf (buf, "0x%x", (uintptr_t) handle);
> 
> What is pthread_t on your platform?  An integral type (which one), pointer
> or something different (e.g. an aggregate)?

The "but argument 5" in there is also weird, sprintf has 3 arguments.
Doesn't current gcc emit warnings like:
/tmp/j.c: In function ‘main’:
/tmp/j.c:8:21: warning: format ‘%x’ expects argument of type ‘unsigned int’, 
but argument 3 has type ‘long unsigned int’ [-Wformat=]
    8 |   sprintf (buf, "0x%x", l);
      |                    ~^   ~
      |                     |   |
      |                     |   long unsigned int
      |                     unsigned int
      |                    %lx
?
So, what exact compiler is compiling this code?

        Jakub

Reply via email to