This is an archive of the discontinued LLVM Phabricator instance.

scudo/standalone: prepare for enabling format string checking
ClosedPublic

Authored by dvyukov on Aug 12 2021, 10:31 PM.

Details

Summary

Move attribute((format)) to the function declarations in the header file.
It's almost pointless in the source file.
But disable the warning with -Wno-format for now
since there is a number of existing warnings.

Depends on D107984.

Diff Detail

Event Timeline

dvyukov created this revision.Aug 12 2021, 10:31 PM
dvyukov requested review of this revision.Aug 12 2021, 10:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2021, 10:31 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript

This change maybe a bit pointless on its own, but it makes state of scudo/standalone consistent with other sanitizers.
FTR, here is the current list of warnings:

scudo/standalone/size_class_map.h:339:24: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'scudo::u32' (aka 'unsigned int')
scudo/standalone/size_class_map.h:339:24: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'scudo::u32' (aka 'unsigned int')
scudo/standalone/size_class_map.h:339:24: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'scudo::u32' (aka 'unsigned int')
scudo/standalone/size_class_map.h:339:24: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'scudo::u32' (aka 'unsigned int')
scudo/standalone/size_class_map.h:339:24: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'scudo::u32' (aka 'unsigned int')
scudo/standalone/secondary.h:608:7: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'scudo::u32' (aka 'unsigned int')
scudo/standalone/secondary.h:608:45: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'scudo::u32' (aka 'unsigned int')
scudo/standalone/secondary.h:609:7: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'unsigned int'
scudo/standalone/secondary.h:608:7: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'scudo::u32' (aka 'unsigned int')
scudo/standalone/secondary.h:608:45: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'scudo::u32' (aka 'unsigned int')
scudo/standalone/secondary.h:609:7: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'unsigned int'
scudo/standalone/secondary.h:608:7: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'scudo::u32' (aka 'unsigned int')
scudo/standalone/secondary.h:608:45: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'scudo::u32' (aka 'unsigned int')
scudo/standalone/secondary.h:609:7: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'unsigned int'
scudo/standalone/primary64.h:169:36: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'int'
scudo/standalone/primary64.h:169:36: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'int'
scudo/standalone/primary64.h:169:36: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'int'
scudo/standalone/primary64.h:169:36: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'int'
scudo/standalone/primary64.h:169:36: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'int'
scudo/standalone/primary64.h:169:36: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'int'
scudo/standalone/primary64.h:169:36: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'int'
scudo/standalone/primary64.h:169:36: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'int'
scudo/standalone/secondary.h:608:7: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'scudo::u32' (aka 'unsigned int')
scudo/standalone/secondary.h:608:45: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'scudo::u32' (aka 'unsigned int')
scudo/standalone/secondary.h:609:7: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'unsigned int'
scudo/standalone/secondary.h:608:7: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'scudo::u32' (aka 'unsigned int')
scudo/standalone/secondary.h:608:45: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'scudo::u32' (aka 'unsigned int')
scudo/standalone/secondary.h:609:7: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'unsigned int'
scudo/standalone/secondary.h:608:7: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'scudo::u32' (aka 'unsigned int')
scudo/standalone/secondary.h:608:45: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'scudo::u32' (aka 'unsigned int')
scudo/standalone/secondary.h:609:7: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'unsigned int'
scudo/standalone/primary64.h:169:36: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'int'

vitalybuka accepted this revision.Aug 12 2021, 11:58 PM
This revision is now accepted and ready to land.Aug 12 2021, 11:58 PM