diff options
author | Mitch Phillips <mitchphillips@outlook.com> | 2019-07-11 18:07:03 +0000 |
---|---|---|
committer | Mitch Phillips <mitchphillips@outlook.com> | 2019-07-11 18:07:03 +0000 |
commit | af3dc759e786324c8a38fa7849da0791b99e67b0 (patch) | |
tree | 885bcf73b16c885a14ca53896f711da00ce8bdfa | |
parent | 63efb28f47610e470cdf9332e2a38b6991cae6f4 (diff) | |
download | llvm-af3dc759e786324c8a38fa7849da0791b99e67b0.zip llvm-af3dc759e786324c8a38fa7849da0791b99e67b0.tar.gz llvm-af3dc759e786324c8a38fa7849da0791b99e67b0.tar.bz2 |
Explicitly define __STDC_FORMAT_MACROS for PRIu64
Summary:
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.
Author: DTharun
Reviewers: hctim
Reviewed By: hctim
Differential Revision: https://reviews.llvm.org/D64388
llvm-svn: 365801
-rw-r--r-- | compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp b/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp index 3180684..7e3628e 100644 --- a/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp +++ b/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp @@ -10,6 +10,12 @@ #include "gwp_asan/options.h" +// RHEL creates the PRIu64 format macro (for printing uint64_t's) only when this +// macro is defined before including <inttypes.h>. +#ifndef __STDC_FORMAT_MACROS + #define __STDC_FORMAT_MACROS 1 +#endif + #include <assert.h> #include <inttypes.h> #include <stdio.h> |