Skip to content

Windows 32-bit build fails: ambiguous Message::setHeader call in FixedBufferProxyTests.cpp (C2668) #18637

Closed

Description

@mbaynton

Summary

The main Windows hourly build fails while compiling the 32-bit session components:

src\cpp\core\http\FixedBufferProxyTests.cpp(393): error C2668: 'rstudio::core::http::Message::setHeader': ambiguous call to overloaded function
src\cpp\core\http\FixedBufferProxyTests.cpp(811): error C2668: 'rstudio::core::http::Message::setHeader': ambiguous call to overloaded function
ERROR: 32-bit session components build failed

Root cause

FixedBufferProxyTests.cpp (added in #18541, "Stream localhost proxy responses") calls:

pResponse->setHeader("Content-Length", body.size());

Message::setHeader has overloads taking (const std::string&, int) and (const std::string&, uintmax_t). In the 32-bit build, body.size() is a 32-bit size_t, which matches neither overload exactly, so MSVC cannot choose and emits C2668. The 64-bit build is unaffected because size_t and uintmax_t are the same width there.

Fix

Disambiguate at both call sites, e.g.:

pResponse->setHeader("Content-Length", static_cast<uintmax_t>(body.size()));

(Alternatively, narrow the setHeader overload set so 32-bit size_t resolves unambiguously.)

Notes

PR builds don't build the 32-bit session components (to save time), so this class of failure can only surface in the full Windows pipeline

Activity

  1. self-assigned this
    on Aug 25, 2026
  2. added a commit that references this issue on Aug 25, 2026
    a8f7d30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions