smeenai added a comment.

Note that the alignment matters in addition to the size.

The pattern I've seen internally is people using `%zd` for NSInteger and `%tu` 
for NSUInteger, since until clang 6 neither of those were format-checked at all.

I'd be fine with adding an option to relax the printf checking if the size and 
alignment of the specifier and the actual type match, even if the types 
themselves differ (`-Wformat-relaxed` or something similar), so that you'd 
still get warnings on cases where the specifier mismatch could cause runtime 
issues. I think that would be preferable to special-casing the Apple types.


Repository:
  rC Clang

https://reviews.llvm.org/D42933



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to