summaryrefslogtreecommitdiff
path: root/include/sanitizer/asan_interface.h
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2017-12-21 20:51:16 +0000
committerPetr Hosek <phosek@chromium.org>2017-12-21 20:51:16 +0000
commitbeb22912bbcd54decea94debe2892bf3489c33ce (patch)
treed2367c98c2350718995fa914a65da84d7bb62346 /include/sanitizer/asan_interface.h
parent9090db487e55a83176aecb2810e3f5f2eee39cf1 (diff)
[sanitizer] Make function declarations C-compatible
The public sanitizer headers are intended to be usable from either C++ or C, but they declare no-argument functions with the syntax that is not a proper prototype declaration in C. This goes unnoticed until someone uses -Wsystem-headers. Patch By: mcgrathr Reviewers: phosek, vitalybuka Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D41475 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321305 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/sanitizer/asan_interface.h')
-rw-r--r--include/sanitizer/asan_interface.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/include/sanitizer/asan_interface.h b/include/sanitizer/asan_interface.h
index e689a730e..f2d77143b 100644
--- a/include/sanitizer/asan_interface.h
+++ b/include/sanitizer/asan_interface.h
@@ -64,19 +64,19 @@ extern "C" {
// Useful for calling from a debugger to get information about an ASan error.
// Returns 1 if an error has been (or is being) reported, otherwise returns 0.
- int __asan_report_present();
+ int __asan_report_present(void);
// Useful for calling from a debugger to get information about an ASan error.
// If an error has been (or is being) reported, the following functions return
// the pc, bp, sp, address, access type (0 = read, 1 = write), access size and
// bug description (e.g. "heap-use-after-free"). Otherwise they return 0.
- void *__asan_get_report_pc();
- void *__asan_get_report_bp();
- void *__asan_get_report_sp();
- void *__asan_get_report_address();
- int __asan_get_report_access_type();
- size_t __asan_get_report_access_size();
- const char *__asan_get_report_description();
+ void *__asan_get_report_pc(void);
+ void *__asan_get_report_bp(void);
+ void *__asan_get_report_sp(void);
+ void *__asan_get_report_address(void);
+ int __asan_get_report_access_type(void);
+ size_t __asan_get_report_access_size(void);
+ const char *__asan_get_report_description(void);
// Useful for calling from the debugger to get information about a pointer.
// Returns the category of the given pointer as a constant string.
@@ -118,21 +118,21 @@ extern "C" {
// User may provide function that would be called right when ASan detects
// an error. This can be used to notice cases when ASan detects an error, but
// the program crashes before ASan report is printed.
- void __asan_on_error();
+ void __asan_on_error(void);
// Prints accumulated stats to stderr. Used for debugging.
- void __asan_print_accumulated_stats();
+ void __asan_print_accumulated_stats(void);
// This function may be optionally provided by user and should return
// a string containing ASan runtime options. See asan_flags.h for details.
- const char* __asan_default_options();
+ const char* __asan_default_options(void);
// The following 2 functions facilitate garbage collection in presence of
// asan's fake stack.
// Returns an opaque handler to be used later in __asan_addr_is_in_fake_stack.
// Returns NULL if the current thread does not have a fake stack.
- void *__asan_get_current_fake_stack();
+ void *__asan_get_current_fake_stack(void);
// If fake_stack is non-NULL and addr belongs to a fake frame in
// fake_stack, returns the address on real stack that corresponds to