[PATCH] D64388: Explicitly define __STDC_FORMAT_MACROS for PRIu64

Dangeti Tharun kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 9 00:23:35 PDT 2019


DTharun created this revision.
Herald added subscribers: Sanitizers, llvm-commits, kubamracek.
Herald added projects: LLVM, Sanitizers.

Builds are failing on RHEL machines because of PRIu64.

lvm/projects/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp:420:50: error: expected ')'

  snprintf(ThreadBuffer, kThreadBufferLen, "%" PRIu64, ThreadID);

inttypes.h in RHEL uses PRIu64 macros only when __STDC_FORMAT_MACROS is defined.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D64388

Files:
  lib/gwp_asan/guarded_pool_allocator.cpp


Index: lib/gwp_asan/guarded_pool_allocator.cpp
===================================================================
--- lib/gwp_asan/guarded_pool_allocator.cpp
+++ lib/gwp_asan/guarded_pool_allocator.cpp
@@ -11,6 +11,9 @@
 #include "gwp_asan/options.h"
 
 #include <assert.h>
+#ifndef __STDC_FORMAT_MACROS
+	#define __STDC_FORMAT_MACROS 1
+#endif
 #include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64388.208603.patch
Type: text/x-patch
Size: 410 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190709/89d7852c/attachment.bin>


More information about the llvm-commits mailing list