[PATCH] D48852: [Sema] -Wformat-pedantic only for NSInteger/NSUInteger %tu/%td on Darwin

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 5 13:14:04 PDT 2018


aaron.ballman added a comment.

In https://reviews.llvm.org/D48852#1153598, @arphaman wrote:

> In https://reviews.llvm.org/D48852#1153415, @aaron.ballman wrote:
>
> > > This is acceptable because Darwin guarantees that, despite the watchOS ABI differences, sizeof(ptrdiff_t) == sizeof(NS[U]Integer)
> >
> > Can you describe these ABI differences please? Also, does Darwin guarantee that alignof(ptrdiff_t) == alignof(NS[U]Integer)?
>
>
> The ABI difference boils down to the following:
>
> Regular 32-bit Darwin targets (like armv7) use 'ptrdiff_t' of type 'int', which matches 'NSInteger'.
>  WatchOS arm iOS target (armv7k) uses 'ptrdiff_t' of type 'long', which doesn't match 'NSInteger' of type 'int'.


Thank you for the explanation, I appreciate it.


https://reviews.llvm.org/D48852





More information about the cfe-commits mailing list