Bug 232423

Summary: [watchOS] Fix logging
Product: WebKit Reporter: Myles C. Maxfield <mmaxfield>
Component: New BugsAssignee: Myles C. Maxfield <mmaxfield>
Status: RESOLVED FIXED    
Severity: Normal CC: eric.carlson, ews-watchlist, glenn, jer.noble, philipj, sergio, sihui_liu, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Myles C. Maxfield 2021-10-27 23:20:33 PDT
[watchOS] Fix logging
Comment 1 Myles C. Maxfield 2021-10-27 23:22:48 PDT
Created attachment 442677 [details]
Patch
Comment 2 EWS 2021-10-28 09:39:00 PDT
Committed r284988 (243635@main): <https://commits.webkit.org/243635@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 442677 [details].
Comment 3 Radar WebKit Bug Importer 2021-10-28 09:39:20 PDT
<rdar://problem/84761390>
Comment 4 Alexey Proskuryakov 2021-10-28 09:46:05 PDT
Comment on attachment 442677 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=442677&action=review

> Source/WebCore/ChangeLog:10
> +        OSStatus is typedef'ed to an SInt32. On watchOS, SInt32 is typedef'ed to be a signed long.
> +        A signed long on watchOS is 4 bytes long. On non-watchOS, SInt32 is typedef'ed to be a signed int.
> +        So, if we want to use printf formatting strings, we have to cast the OSStatus to an int.

It sounds like it would be nicer to cast it to signed long instead, given this explanation.
Comment 5 Myles C. Maxfield 2021-10-28 10:11:28 PDT
Comment on attachment 442677 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=442677&action=review

>> Source/WebCore/ChangeLog:10
>> +        So, if we want to use printf formatting strings, we have to cast the OSStatus to an int.
> 
> It sounds like it would be nicer to cast it to signed long instead, given this explanation.

Really? OSStatus ends up being 4 bytes on every platform, and int is also 4 bytes on every platform - so I thought it would be a perfect fit. Why is long better?