Issue 89968
Summary ER: Add diagnostic to flag using "%P" specifier with Objective-C pointers
Labels new issue
Assignees
Reporter jaredgrubb
    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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to