This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Get rid of builtin-declaration-mismatch warnings
ClosedPublic

Authored by cryptoad on Jul 3 2018, 10:07 AM.

Details

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.

Diff Detail

Event Timeline

cryptoad created this revision.Jul 3 2018, 10:07 AM
Herald added subscribers: Restricted Project, delcypher. · View Herald TranscriptJul 3 2018, 10:07 AM
alekseyshl accepted this revision.Jul 3 2018, 10:09 AM
This revision is now accepted and ready to land.Jul 3 2018, 10:09 AM
This revision was automatically updated to reflect the committed changes.