Repository navigation
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9e9f1014c6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| bytes.resize(8); | ||
| double d = val; | ||
| memcpy(bytes.data(), &d, bytes.size()); |
There was a problem hiding this comment.
Keep set10Byte writing a full 10-byte payload
With the new systemHasLongDouble() check, non-x87 platforms (e.g. long double as IEEE-128) now enter this branch and only write 8 bytes for set10Byte(). That regresses behavior for those targets because get10Byte() still reads 10 bytes, so a value written via set10Byte() can later fail to read back or include stale trailing bytes from previous data at address+8..9. This API should continue to serialize a complete 10-byte value (or explicitly pad/convert to 10 bytes) to stay consistent with the rest of the 10-byte read path.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Good catch — fixed in c9257f4.
You're right that set10Byte() wrote only 8 bytes on non-x87 platforms while get10Byte() always reads 10 bytes and decodes them as an 80-bit extended value, leaving the trailing 2 bytes stale. On top of that, the 8 written bytes were in native-double layout rather than the 80-bit extended layout the reader expects, so the value couldn't round-trip at all.
The fix adds double8ToDouble10() as the inverse of the existing double10ToDouble8() and uses it so the non-x87 branch always serializes a complete 10-byte extended value, keeping the write path symmetric with the read path.
Verified with a forward/inverse round-trip test: exact for all normal numbers, ±0, inf and nan. The double-subnormal range still flushes to zero, but that's the pre-existing behavior of double10ToDouble8()'s underflow handling on the read side, so symmetry holds.
set10Byte() wrote only an 8-byte native double on platforms that do not use the x87 80-bit long double representation, while get10Byte() always reads 10 bytes and decodes them as an 80-bit extended value. The two trailing bytes were left stale and, worse, the 8 written bytes were in native-double layout rather than the 80-bit extended layout the reader expects, so values could not round-trip. Add double8ToDouble10() as the inverse of double10ToDouble8() and use it to serialize a complete 10-byte extended value, keeping the write path symmetric with the read path. Round-trips are exact for all normal numbers, zero, inf and nan; the double-subnormal range remains flushed to zero by the existing double10ToDouble8() underflow handling. Addresses Codex review feedback on avast#1232. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
This change updates the build and test setup so the project builds cleanly without visible warnings or errors in the verified CMake build tree.
The main areas covered are:
Details
Third-party build compatibility
First-party warning fixes
Verification
Verified locally with:
Result:
CTest was also invoked:
Result:
Because CTest did not enumerate tests in this build tree, all built test executables were run directly:
Result: