Skip to content

Attempt to fix Clang build.#3310

Merged
0blu merged 1 commit intovmangos:developmentfrom
mserajnik:fix-chathandler-varargs
Mar 30, 2026
Merged

Attempt to fix Clang build.#3310
0blu merged 1 commit intovmangos:developmentfrom
mserajnik:fix-chathandler-varargs

Conversation

@mserajnik
Copy link
Copy Markdown
Contributor

@mserajnik mserajnik commented Mar 30, 2026

🍰 Pullrequest

Add a missing .c_str() to hopefully fix the Clang build, this is another regression introduced in 6f25c89:

/home/runner/work/core/core/src/game/Handlers/ChatHandler.cpp:57:163: error: cannot pass non-trivial object of type 'std::string' (aka 'basic_string<char>') to variadic method; expected type from format string was 'char *' [-Wnon-pod-varargs]
   57 |         sLog.Out(LOG_BASIC, LOG_LVL_ERROR, "Player %s (GUID: %u) sent a chatmessage with an invalid link: %s", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow(), msg);
      |                                                                                                           ~~                                                      ^~~
/home/runner/work/core/core/src/game/Handlers/ChatHandler.cpp:57:163: note: did you mean to call the c_str() method?
   57 |         sLog.Out(LOG_BASIC, LOG_LVL_ERROR, "Player %s (GUID: %u) sent a chatmessage with an invalid link: %s", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow(), msg);
      |                                                                                                                                                                   ^  
      |                                                                                                                                                                      .c_str()

Note: I don't have a Clang compiler setup, so this might only be a partial fix. This error surfaced when I rebased #2987 on the latest commit (since that triggered a Clang build); there may be other errors still that the build simply didn't get to before this one occurred.

Proof

  • None

Issues

  • None

How2Test

  • None

Todo / Checklist

  • None

@0blu 0blu merged commit feaa602 into vmangos:development Mar 30, 2026
3 checks passed
@mserajnik mserajnik deleted the fix-chathandler-varargs branch March 30, 2026 19:54
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.

2 participants