[scudo] Get rid of builtin-declaration-mismatch warnings
authorKostya Kortchinsky <kostyak@google.com>
Tue, 3 Jul 2018 19:03:46 +0000 (19:03 +0000)
committerKostya Kortchinsky <kostyak@google.com>
Tue, 3 Jul 2018 19:03:46 +0000 (19:03 +0000)
commite64a81475c3e705d35cf74c451ced12ee0dc9ffb
tree7254cbe1ad664302d60a2d51722c4f927ba89edb
parent181aa26eb87070a109ab7173c2d7916a448c2100
[scudo] Get rid of builtin-declaration-mismatch warnings

Summary:
The C interceptors were using `SIZE_T` defined in the interception library as
a `__sanitizer::uptr`. On some 32-bit platforms, this lead to the following
warning:
```
warning: declaration of ‘void* malloc(SIZE_T)’ conflicts with built-in declaration ‘void* malloc(unsigned int)’ [-Wbuiltin-declaration-mismatch]
INTERCEPTOR_ATTRIBUTE void *malloc(SIZE_T size) {
```
`__sanitizer::uptr` is indeed defined as an `unsigned long` on those.

So just include `stddef.h` and use `size_t` instead.

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: delcypher, llvm-commits, #sanitizers

Differential Revision: https://reviews.llvm.org/D48885

llvm-svn: 336221
compiler-rt/lib/scudo/scudo_malloc.cpp