New issue
Advanced search Search tips

Issue 687611 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Win/Clang ToT compiles failing with -Wcast-calling-convention

Project Member Reported by h...@chromium.org, Feb 1 2017

Issue description

From https://build.chromium.org/p/chromium.fyi/builders/ClangToTWin%28dbg%29/builds/7561/steps/compile/logs/stdio:


../../third_party/llvm-build/Release+Asserts/bin/clang-cl.exe /nologo /showIncludes /FC @obj/third_party/webrtc/base/rtc_base/thread.obj.rsp /c ../../third_party/webrtc/base/thread.cc /Foobj/third_party/webrtc/base/rtc_base/thread.obj /Fd"obj/third_party/webrtc/base/rtc_base_cc.pdb"
C:\b\c\b\ClangToTWin_dbg_\src\third_party\webrtc\base\thread.cc(231,35):  error: cast between incompatible calling conventions 'cdecl' and 'stdcall'; calls through this pointer may abort at runtime [-Werror,-Wcast-calling-convention]
  thread_ = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)PreRun, init, 0,
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\b\c\b\ClangToTWin_dbg_\src\third_party\webrtc\base\thread.h(241,16):  note: consider defining 'PreRun' with the 'stdcall' calling convention
  static void *PreRun(void *pv);
               ^
               STDAPICALLTYPE 




I don't see this on the pinned bots, so might be due to a Clang change.
 

Comment 1 by h...@chromium.org, Feb 1 2017

From https://build.chromium.org/p/chromium.fyi/builders/ClangToTWin(dll)

Last good Clang: 293656
First bad Clang: 293694

It has to be this one:

------------------------------------------------------------------------
r293677 | rnk | 2017-01-31 11:37:45 -0800 (Tue, 31 Jan 2017) | 6 lines

Extend -Wcast-calling-convention to warn on declarations as well as definitions

My original warning was very conservative and I never revisited the
heuristics that were used.

This would have caught  http://crbug.com/687251  at compile time.
------------------------------------------------------------------------

Comment 2 by h...@chromium.org, Feb 1 2017

Oh, and that warning was to target this specific code, which is getting fixed here: https://codereview.chromium.org/2667863003/

Comment 3 by h...@chromium.org, Feb 1 2017

etienne's fix landed here: https://codereview.webrtc.org/2668693005/

I suppose we're waiting for a webrtc roll.

Comment 4 by r...@chromium.org, Feb 1 2017

Sorry, I knew this would break the ToT waterfall, but I figured Etienne's webrtc fix would get rolled in in a matter of hours, not a whole day later.

Comment 5 by h...@chromium.org, Feb 6 2017

Status: Fixed (was: Assigned)

Sign in to add a comment