This is an archive of the discontinued LLVM Phabricator instance.

sanitizer_common: support %l in format strings
ClosedPublic

Authored by dvyukov on Aug 13 2021, 11:38 PM.

Details

Summary

Currently we only support %z and %ll width modifiers,
but surprisingly not %l. This makes it impossible to print longs
(sizeof(long) not necessary equal to sizeof(size_t)).
We had some printf's that printed longs with %zu,
but that's wrong and now with attribute((format)) in place
they are flagged by compiler. So we either have a choice of
doing static_cast<uptr>(long) everywhere or add %l.
Adding %l looks better, that's a standard modifier.

Diff Detail

Event Timeline

dvyukov requested review of this revision.Aug 13 2021, 11:38 PM
dvyukov created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptAug 13 2021, 11:38 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
vitalybuka accepted this revision.Aug 14 2021, 5:31 PM
This revision is now accepted and ready to land.Aug 14 2021, 5:31 PM
This revision was landed with ongoing or failed builds.Aug 14 2021, 5:57 PM
This revision was automatically updated to reflect the committed changes.