Declare the last four operator new overloads with size_t - #2731
Conversation
port/build-port.cmd has not compiled since 010b269 (2026-09-14). 32-bit MSVC rejects include/fBase_c.h:158 with error C2821: first formal parameter to 'operator new' must be 'size_t' The rule is on the TYPE, not the width -- all three candidate spellings are four bytes on this target. mwccarm rejects `operator new(unsigned int)` as an illegal operator declaration; MSVC rejects `operator new(unsigned long)`. include/types.h already carries the resolution: a conditional size_t, <stddef.h> under _MSC_VER and `typedef unsigned long` otherwise, added for exactly this. Most actor headers already declare `operator new(size_t)`; these four were never converted and still name the literal type. No ROM byte moves, because size_t IS unsigned long for mwccarm. Measured with a build that recompiles every translation unit reaching these headers: rombuild -j16 --no-rom 1963 compiled, mismatching 0, module fidelity 106/106 exact, ROM-build PASS This does NOT make the port green. It clears the compile error, after which four of fourteen smoke targets build and pass and nine fail to LINK for an unrelated reason: _ZN5ModelC1Ev and _ZN5ModelC2Ev both define Model::Model() once MSVC mangles them, and the port's bridges reference ModelBase::Destructor0/Destructor1, which nothing defines. Those are C++-migration seams in port/hal and need their own change. Note that ctest reports them as failing tests, but they are "Not Run": the executables never linked. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y4FxdKHG3a6hQRYRAbx29c
✅ PR validation — PassedCommitted merge introduces no reconstruction or attribution regression. Full merge validation
Byte-verified means the range carries Warnings: 6 linkcheck result(s) have unresolved relocations; 1 affected source file(s) could not be fully link-checked. Per-file link-check detail1 of 1991 changed file(s) do not match the ROM (NO-SYM).
The private worker commits a test merge, builds the stock ROM profile, compares every executable module, measures matched and source-built code, checks contributor lineage, and verifies affected relocations. The mod profile is opt-in and is not part of this merge gate. |
⏳ PR validation — ValidatingBuilding This comment is replaced with the verdict when it finishes. |
Adversarial review — seven-PR set (#2725–#2731)Re-reviewed as a critic rather than as the author. Every check below is new work, not a 1. Relocation destinations — the hazard the byte gate cannot seeA relocated word is a wildcard: a
0 WRONG-DEST across 125 files and 61 TU functions. This also closes the cast-receiver 2. Merge tree, cold
3. Change-kind census139 files changed in the merge tree, all 4. Local-only gates, run on the merge tree (CI runs none of these on a merge tree)
5. The merged decl baseline is not a silent clobber
0 hidden. Every difference is in the safe direction. (Separately: ~84 stale banked entries 6. The MSVC port build — differential, not absolute
The other six PRs introduce zero new port link errors. What remains is the pre-existing 7. Per-PR findings
VerdictNo defect found, and no change requested. Both incomplete migrations are incomplete on The one thing this review cannot supply is the thing the review gate actually wants: I am the 🤖 Generated with Claude Code |
port/build-port.cmdhas not compiled since010b269ef(2026-09-14). On a cleanorigin/mainwith nothing modified, 32-bit MSVC rejectsinclude/fBase_c.h:158:No CI job builds the port, so nothing went red.
The rule is on the type, not the width
All three candidate spellings are four bytes on this target. mwccarm rejects
operator new(unsigned int)as an illegal operator declaration; 32-bit MSVC rejectsoperator new(unsigned long).include/types.halready carries the resolution — aconditional
size_t,<stddef.h>under_MSC_VERandtypedef unsigned longotherwise — added for exactly this, with a comment noting that no ROM byte moves because
mwccarm keeps the
unsigned longthe actor headers declare.Most headers already declare
operator new(size_t). Four were never converted andstill name the literal type:
fBase_c.h,daBar_c.h,daObjTh_Fall_Block_c.h,daTBasket_c.h. This changes those four.Byte-neutrality is measured, not asserted
size_tisunsigned longfor mwccarm, so the declaration is token-different andtype-identical. The build recompiles every translation unit that reaches these headers:
1,963 real compiles — this is exercised, not a cache hit.
This does not make the port green
It clears the compile error. After it, four of fourteen smoke targets build and pass
(
smoke,smoke_heap,smoke_roots,smoke_gx, plussmoke_fs) and nine fail tolink, for a reason unrelated to
operator new:In the Itanium ABI
C1andC2are distinct symbols; compiled as real C++ by MSVC bothcollapse to one
??0Model@@QAE@XZ, so the two files collide. Separately, the port'sbridges reference
ModelBase::Destructor0/Destructor1, which nothing defines. Those areC++-migration seams in
port/haland need their own change.Worth knowing when reading the output: ctest reports those nine as failing tests, but they
are
***Not Run— the executables never linked, so no assertion ran.🤖 Generated with Claude Code
https://claude.ai/code/session_01Y4FxdKHG3a6hQRYRAbx29c