Weird Windows Bot errors

8 views
Skip to first unread message

Fady Samuel

unread,
Apr 27, 2016, 11:50:51 PM4/27/16
to chromium-dev
I have made some changes to ui/gfx that should be entirely unrelated to extensions and sockets and yet I'm seeing this very odd error. It seems like a couple of macros are expanding to replace "interface" with "struct" A simple solution is to simply rename this variable but I can't figure out why the windows bots aren't complaining except after applying my patch...

Fady

../../extensions/browser/api/socket/socket_api.cc(799,37):  error: expected unqualified-id
  for (const net::NetworkInterface& interface : interface_list) {
                                    ^
E:\b\depot_tools\win_toolchain\vs_files\95ddda401ec5678f15eeed01d2bee08fcbc5ee97\win_sdk\bin\..\..\win_sdk\Include\10.0.10586.0\um\combaseapi.h(193,19):  note: expanded from macro 'interface'
#define interface __STRUCT__
                  ^
E:\b\depot_tools\win_toolchain\vs_files\95ddda401ec5678f15eeed01d2bee08fcbc5ee97\win_sdk\bin\..\..\win_sdk\Include\10.0.10586.0\um\combaseapi.h(192,20):  note: expanded from macro '__STRUCT__'
#define __STRUCT__ struct
                   ^
../../extensions/browser/api/socket/socket_api.cc(807,3):  error: expected ';' in 'for' statement specifier
  results_ = api::socket::GetNetworkList::Results::Create(create_arg);
  ^
../../extensions/browser/api/socket/socket_api.cc(807,12):  error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses]
  results_ = api::socket::GetNetworkList::Results::Create(create_arg);
  ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../extensions/browser/api/socket/socket_api.cc(807,12):  note: place parentheses around the assignment to silence this warning
  results_ = api::socket::GetNetworkList::Results::Create(create_arg);
           ^
  (                                                                  )
../../extensions/browser/api/socket/socket_api.cc(807,12):  note: use '==' to turn this assignment into an equality comparison
  results_ = api::socket::GetNetworkList::Results::Create(create_arg);
           ^
           ==
../../extensions/browser/api/socket/socket_api.cc(808,21):  error: expected ')'
  SendResponse(true);
                    ^
../../extensions/browser/api/socket/socket_api.cc(799,7):  note: to match this '('
  for (const net::NetworkInterface& interface : interface_list) {
      ^
4 errors generated.

Ryan Sleevi

unread,
Apr 27, 2016, 11:57:53 PM4/27/16
to Fady Samuel, Chromium-dev

What's your CL?

Did you add a new header which is now being transitively included into that file? Like a COM header in the UI code?

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

Fady Samuel

unread,
Apr 28, 2016, 12:02:19 AM4/28/16
to rsl...@chromium.org, Chromium-dev
Here's the CL: https://codereview.chromium.org/1924613002/ 

I don't think I added a new COM header...

Fady

Ryan Sleevi

unread,
Apr 28, 2016, 12:16:57 AM4/28/16
to Fady Samuel, Ryan Sleevi, Chromium-dev
On Wed, Apr 27, 2016 at 9:01 PM, Fady Samuel <fsa...@google.com> wrote:
Here's the CL: https://codereview.chromium.org/1924613002/ 

I don't think I added a new COM header...

You ended up pulling in windows.h to an IPC header, which then was transitively included in that extensions code, and the windows.h bits squats on the word "interface" via the #define in the error messages you were seeing.

Simple fix is to just rename the variable ("interface") in that for loop of the extensions code, as well as thing about whether you want to include range.h in your IPC definitions or whether it makes sense to forward declare (so that everyone IPC'ing those messages isn't pulling in unnecessary headers) 

Brett Wilson

unread,
Apr 28, 2016, 12:17:12 AM4/28/16
to Fady Samuel, Ryan Sleevi, Chromium-dev
I'm guessing you tweaked a param traits file and added some gfx thing that wasn't there before that's then letting socket_api.cc see windows headers. It's probably a bad idea to name anything "interface" and I would just rename the variable.

Brett

Fady Samuel

unread,
Apr 28, 2016, 12:19:44 AM4/28/16
to Brett Wilson, Ryan Sleevi, Chromium-dev
Thanks Ryan and Brett for your feedback! Looks like I should forward declare Range in this CL, and then in a separate CL I'll rename the variable name interface. Thanks again!

Fady
Reply all
Reply to author
Forward
0 new messages