[PATCH] D74821: Fix build after Crash handler API was introduced

Andrzej Perczak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 19 01:26:29 PST 2020


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

__STDC_FORMAT_MACROS define has to be moved to preserve previous behaviour, otherwise build fails with:

  llvm-project/compiler-rt/lib/gwp_asan/optional/segv_handler_posix.cpp:120:50: error: expected ')'
      snprintf(ThreadBuffer, kThreadBufferLen, "%" PRIu64, ThreadID);
                                                   ^


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74821

Files:
  compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp
  compiler-rt/lib/gwp_asan/optional/segv_handler_posix.cpp


Index: compiler-rt/lib/gwp_asan/optional/segv_handler_posix.cpp
===================================================================
--- compiler-rt/lib/gwp_asan/optional/segv_handler_posix.cpp
+++ compiler-rt/lib/gwp_asan/optional/segv_handler_posix.cpp
@@ -12,6 +12,12 @@
 #include "gwp_asan/optional/segv_handler.h"
 #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 <signal.h>
Index: compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp
===================================================================
--- compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp
+++ compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp
@@ -13,12 +13,6 @@
 #include "gwp_asan/random.h"
 #include "gwp_asan/utilities.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 <signal.h>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74821.245350.patch
Type: text/x-patch
Size: 1216 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200219/380cf6e2/attachment.bin>


More information about the llvm-commits mailing list