Closed
Description
Darwin has an extension on the printf format-specifiers for "%P", which dumps the bytes at a pointer (in contrast to "%p" which dumps a pointer's value itself) and is allowed in "OS Log" contexts.
It's easy to misuse this, for example:
NSUUID *uuid = ...;
os_log(..., "%{uuid_t}.16P", uuid);
This dumps the ObjC class data (eg, the is-a pointer) -- not the UUID represented by the object.
It'd be nice if the compiler had a warning that could flag this misuse, which seems to always (IMO) be a bug.