Hi Jakub,

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);
      |                 ^~~~~~  ~~~~~~~~~~~~~~~~~~
      |                         |
      |                         long unsigned int
../../../work/libgomp/affinity-fmt.c:369:21: note: format string is defined here
  369 |   sprintf (buf, "0x%x", (uintptr_t) handle);
      |                    ~^
      |                     |
      |                     unsigned int
      |                    %lx
cc1: all warnings being treated as errors

I have managed to bootstrap with the following hack:

--- ../_clean/libgomp/affinity-fmt.c    2018-11-08 19:03:37.000000000 +0100
+++ libgomp/affinity-fmt.c      2018-11-09 01:00:16.000000000 +0100
@@ -362,11 +362,11 @@ gomp_display_affinity (char *buffer, siz
              char buf[3 * (sizeof (handle) + sizeof (int)) + 4];
 
              if (sizeof (handle) == sizeof (long))
-               sprintf (buf, "0x%lx", (long) handle);
+               sprintf (buf, "0x%lx", (long) (uintptr_t) handle);
              else if (sizeof (handle) == sizeof (long long))
-               sprintf (buf, "0x%llx", (long long) handle);
+               sprintf (buf, "0x%llx", (long long) (uintptr_t) handle);
              else
-               sprintf (buf, "0x%x", (int) handle);
+               sprintf (buf, "0x%x", (int) (uintptr_t) handle);
              gomp_display_num (buffer, size, &ret, zero, right, sz, buf);
              break;
            }

which is certainly wrong, but allowed me to bootstrap.

TIA

Dominique

PS I can file a PR if necessary.

Reply via email to