wip: bulk add 'll' to printf log tags#64
Draft
jwoglom wants to merge 3 commits into
Draft
Conversation
Xcode 26.5 flags 'Format specifies int but argument has Int (Int64)'
on String(format:) and OSLog log.* calls that pass Swift integer
values to %d/%i/%u/%x/%X/%o. Swift's Int/UInt are 64-bit on Apple
64-bit platforms and Swift's CVarArg conformance widens smaller
integers to a 64-bit word when bridged through varargs, so the
canonical fix is to add the 'll' length modifier.
Pattern applied:
- signed int arg -> %lld (preserves width/positional: %02d -> %02lld,
%1$03d -> %1$03lld)
- unsigned int arg -> %llu
- hex -> %llx / %llX (preserves width: %08X -> %08llX)
- %g for Double -> %@ with the existing .twoDecimals extension
%02hhx in Common/Data.swift (byte-encoding loop) is left as-is - the
'hh' modifier is correct there.
Also fixes two pre-existing typos discovered during the sweep:
- ErosPodComms.swift line 104 was missing the '%' on the first format
string ('08X' -> '%08llX').
- DeactivatePodViewModel.swift line 148 had a duplicate %2$ positional
index; the third arg now correctly uses %3$@.
Required before bumping Xcode for the browser build.
The previous patch swept String(format:) and bare-percent OSLog format
specifiers but missed sites using the OSLog visibility modifier syntax
(%{public}d / %{public}x / %{public}02x), which Clang's os_log format
checking still validates against the underlying d/x/X/u length.
Same canonical fix as the prior commit: add the 'll' length modifier
where the argument is a Swift Int/UInt/UInt32 widened to 64 bits via
CVarArg. .count, msgSeq/nonceSeq/messageNumber, maxWriteValueLength,
toUInt32() addresses, queue depths, attempts, services counts, etc.
Files touched:
- BleMessageTransport.swift (transport phase logging)
- BlePodComms.swift (O5 AID command logging, MTU polling)
- BluetoothManager.swift (advertisement scan)
- O5KeyExchange.swift (key derivation/nonce diagnostics)
- O5LTKExchanger.swift (full SPS0/SPS1/SPS2.1/SPS2 pairing log)
- PeripheralManager(+OmnipodKit).swift (BLE raw write/read,
packet split/join, waitForCommand)
- Session/SessionEstablisher.swift (EAP-AKA secondary path)
- Common/OSLog.swift (the fallback fault path itself)
Note: BluetoothManager.swift line 411 has a pre-existing typo
('%{public}' with no format letter) that is unrelated to the 64-bit
issue and left untouched.
Contributor
marionbarker
requested changes
May 29, 2026
Contributor
marionbarker
left a comment
There was a problem hiding this comment.
This PR needs to have the Localization/Localizable.xcstrings updated.
There are 2 parts to this. Once you build with Xcode, the English version are all updated automatically.
However, all the Translations have the old format. This should be adjusted as well.
Collaborator
|
@jwoglom I cannot commit to your repo, so could you replace your xcstring with this one? |
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Collaborator
Author
|
Thanks @bastiaanv , updated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Bulk migrate log and other printf formatted strings in OmnipodKit.