This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Correct format string specifiers
AbandonedPublic

Authored by cryptoad on Aug 13 2021, 8:51 AM.

Details

Summary

Following D108014, address the -Wformat issues.

Diff Detail

Event Timeline

cryptoad created this revision.Aug 13 2021, 8:51 AM
cryptoad requested review of this revision.Aug 13 2021, 8:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 13 2021, 8:51 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
cryptoad planned changes to this revision.Aug 13 2021, 9:04 AM
cryptoad updated this revision to Diff 366308.Aug 13 2021, 10:26 AM

So this turned out to be a little more complicated for 32-b.
The 'z' format specifier expects a size_t which is defined
as a unsigned int on 32-b Linux platforms, while our
scudo::uptr are defined a unsigned long. So zu wasn't
an appropriate specifier on 32-b platforms for a uptr.

This introduces a 'l' format specifier that we didn't previously
have, and replaces 'z' with 'l' for all uptr format strings.

it's probably copied from sanitizer_common
I thing it should match uintptr_t like here 45138f788c9b3c4ac5d9ae4479841c411c15190e

Actually scudo already #include <stdint.h>, so maybe define uptr as uintptr_t ?

cryptoad abandoned this revision.Aug 15 2021, 7:57 AM

Redoing this the way Vitaly suggested.