Skip to content

[Windows][clang] 6369267 does not compile: -Werror,-Wnull-conversion in qwen3_5.cpp (pointer passed as bool return_hidden) #3308

Description

@ElderOrb

Summary

Commit 636926736c0b6053eda99d08c1f753b29938fac0 does not compile with clang on Windows
(the tree builds with -Wall -Wextra -Werror):

src/vllm/model_executor/models/qwen3_5.cpp:12483:65: error: implicit conversion of nullptr constant to 'bool' [-Werror,-Wnull-conversion]
 12480 |       lg = DenseForwardLayers(d, s.hidden->t(), s.positions, s.attn_meta,
       |            ~~~~~~~~~~~~~~~~~~
 12481 |                               s.gdn_meta, attn_kv, gdn_state, impl_->weights,
 12482 |                               impl_->config, {}, nullptr, nullptr, aux_ids_arg,
 12483 |                               aux_out_arg, dbuf ? s.dev.get() : nullptr);
       |                                                                 ^~~~~~~
       |                                                                 false
1 error generated.

Why it fires

The call passes 15 arguments; the 15th parameter of DenseForwardLayers is
bool return_hidden (signature at src/vllm/model_executor/models/qwen3_5.cpp:9822-9836),
so the pointer expression dbuf ? s.dev.get() : nullptr is converted to bool. clang
rejects the null-constant arm under -Werror,-Wnull-conversion.

Passing s.dev.get() as return_hidden also looks unintended at the call site — the 16th
parameter, StepDevInputs* persistent_sdi, is defaulted here, which suggests a reshuffled
argument list rather than an intentional value.

Environment

  • Windows 11 (26200), native Windows build with clang/lld from TheRock 10.0, HIP gfx1151
  • commit 6369267, -O3 -DNDEBUG -g -Xclang -gcodeview, --target server
  • 9e63db5d compiles fine, so this was introduced by one of the 36 commits in between

Local workaround (to get a build)

static_cast<bool>(dbuf ? s.dev.get() : nullptr) — behaviour-preserving, but it does not
fix the likely wrong argument.

Suggested change

Pass the intended boolean (e.g. dbuf != nullptr) or the intended device argument, and make
the call site match the declared parameter list.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions