public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [committed 0/4] (Partial) OpenMP 5.0 support for GCC 9
@ 2018-11-09 10:34 Dominique d'Humières
  2018-11-09 11:05 ` Jakub Jelinek
  0 siblings, 1 reply; 9+ messages in thread
From: Dominique d'Humières @ 2018-11-09 10:34 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches, Rainer Orth

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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-11-09 20:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-09 10:34 [committed 0/4] (Partial) OpenMP 5.0 support for GCC 9 Dominique d'Humières
2018-11-09 11:05 ` Jakub Jelinek
2018-11-09 11:11   ` Jakub Jelinek
2018-11-09 14:49     ` David Malcolm
2018-11-09 14:37   ` [PATCH] Fix up affinity-fmt.c (was Re: [committed 0/4] (Partial) OpenMP 5.0 support for GCC 9) Jakub Jelinek
2018-11-09 15:33     ` Iain Sandoe
2018-11-09 15:40       ` Jakub Jelinek
2018-11-09 18:23         ` Iain Sandoe
2018-11-09 20:24           ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).