Page MenuHomePhabricator

Explicitly define __STDC_FORMAT_MACROS for PRIu64
ClosedPublic

Authored by DTharun on Jul 9 2019, 12:21 AM.

Details

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.

Diff Detail

Repository
rL LLVM

Event Timeline

DTharun created this revision.Jul 9 2019, 12:21 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 9 2019, 12:21 AM
Herald added subscribers: Restricted Project, llvm-commits, kubamracek. · View Herald Transcript
hctim accepted this revision.Jul 10 2019, 12:34 PM

Thanks for catching this. LGTM.

This revision is now accepted and ready to land.Jul 10 2019, 12:34 PM

Thanks for catching this. LGTM.

I don't have commit rights, please submit the patch.

This revision was automatically updated to reflect the committed changes.
lebedev.ri added inline comments.
compiler-rt/trunk/lib/gwp_asan/guarded_pool_allocator.cpp
14

How do you know it wasn't included before somewhere, by some previous header?
This i think normally should be solved by adding -D__STDC_FORMAT_MACROS to compile command.

hctim added inline comments.Jul 11 2019, 11:26 AM
compiler-rt/trunk/lib/gwp_asan/guarded_pool_allocator.cpp
14

So it looks like LLVM handles this through add_definitions( -D__STDC_FORMAT_MACROS ), but subprojects (openmp) does this in the same way as this patch (openmp/runtime/test/ompt/callback.h:6).

I personally like the former, so I'll follow up with a revert + fix later today.