Skip to content

Seed legs, round two: a string literal keeps its pointer cast; two host-specific fixtures - #2589

Merged
ehartford merged 3 commits into
mainfrom
legs2
Oct 23, 2026
Merged

ehartford merged 3 commits into
mainfrom
legs2

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Three findings of the linux-x86_64 and Windows seed legs on the bridge commit (#2582), each a separate commit:

  1. A string literal keeps its pointer cast however the pointee is spelled. After linux seed legs: char pointers are c_char, va_list never decays, the SDK gunzip helper uses std.zlib #2586 made a char pointee c_char on both sides, cast_if_needed dropped (char *)"..." as a same-type cast and zlib's strm->msg = ... became a bare str assigned to a *mut c_char (zlib-build and zlib-check-generated red on both hosts). A string literal is a str, never the pointer its C type spells.
  2. c-migrator-basic-tests, strtoll family: long double is a double only on AArch64 Darwin and Windows; on x86_64 Linux the fixture's long double p4 is untranslatable (loudly, as it must be). The case asks for strtold only where the host has the type.
  3. mlib-test: the multimap lines are compared without the CR that Windows stdio writes.

The same three commits are cherry-picked onto seed-bridge-20261023 (1508cf5), from which the Linux and Windows seeds are being cut. The linux-aarch64 leg stays blocked on #2585. Draft until the battery is green.

Eric Hartford added 3 commits October 23, 2026 15:05
`(char *)"incorrect header check"` migrated to `"..." as *mut c_char`
while a char pointee was spelled `i8`: the cast survived because the
spellings differed. Once the pointee became `c_char` on both sides (#2586),
cast_if_needed dropped it as a same-type cast and zlib's `strm->msg = ...`
became a bare `str` assigned to a `*mut c_char`, refused by Sema
(zlib-build, zlib-check-generated on the linux-x86_64 and Windows seed
legs, #2582). A string literal is a `str`, never the pointer its C type
spells, so a cast to a pointer type is always kept.
…e long double is a double

`long double` is a double only on AArch64 Darwin and Windows (§16.1); on
x86_64 Linux it is the 80-bit type, which With has no float for, so the
fixture's `long double p4` is untranslatable there and the migration fails
loudly, as it must. The case was written on darwin; it now includes p4 and
the `strtold(` assertion only where the host has the type (the
linux-x86_64 seed leg, #2582).
…io writes

upstream's multimap example prints through C's stdio, whose text mode on
Windows ends a line with CRLF, so "Key=6 Count=1 Value=6 \n" was not found
in its output on the Windows seed leg (#2582) although the line was there.
The comparison drops the CR; the other hosts print LF and are unchanged.
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery GREEN at b9525a8 (722 s) and on the stack top 5af1bcb (353 s).

@ehartford
ehartford marked this pull request as ready for review October 23, 2026 19:29
@ehartford
ehartford merged commit 0b796d6 into main Oct 23, 2026
@ehartford
ehartford deleted the legs2 branch October 23, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant