Fix some warnings under accessible/windows

RESOLVED FIXED in Firefox 65

Status

()

defect
RESOLVED FIXED
10 months ago
10 months ago

People

(Reporter: masayuki, Assigned: masayuki)

Tracking

Trunk
mozilla65
All
Windows
Points:
---

Firefox Tracking Flags

(firefox64 wontfix, firefox65 fixed)

Details

Attachments

(2 attachments)

I usually see some warnings under accessible/windows when I change editor code a lot.

13:38.72 warning: c:/mozilla/fx64-dbg/dist/include/mozilla/mscom/AsyncInvoker.h:287:5 [-Wmicrosoft-template] use of undeclared identifier 'mAsyncCall'; unqualif
ied lookup into dependent bases of class template 'AsyncInvoker' is a Microsoft extension
13:38.73 warning: c:/mozilla/fx64-dbg/dist/include/mozilla/mscom/AsyncInvoker.h:287:22 [-Wmicrosoft-template] use of undeclared identifier 'AsyncCallType'; unqu
alified lookup into dependent bases of class template 'AsyncInvoker' is a Microsoft extension
13:38.73 warning: c:/mozilla/fx64-dbg/dist/include/mozilla/mscom/AsyncInvoker.h:309:16 [-Wmicrosoft-template] use of undeclared identifier 'mAsyncCall'; unquali
fied lookup into dependent bases of class template 'AsyncInvoker' is a Microsoft extension
13:38.73 warning: c:/mozilla/fx64-dbg/dist/include/mozilla/mscom/AsyncInvoker.h:310:10 [-Wmicrosoft-template] use of undeclared identifier 'mAsyncCall'; unquali
fied lookup into dependent bases of class template 'AsyncInvoker' is a Microsoft extension
13:38.73 warning: c:/mozilla/fx64-dbg/dist/include/mozilla/mscom/AsyncInvoker.h:314:38 [-Wmicrosoft-template] use of undeclared identifier 'mAsyncCall'; unquali
fied lookup into dependent bases of class template 'AsyncInvoker' is a Microsoft extension
13:38.73 warning: accessible/windows/msaa/AccessibleWrap.cpp:71:41 [-Wmissing-braces] suggest braces around initialization of subobject
13:38.73 warning: accessible/windows/msaa/AccessibleWrap.cpp:1429:22 [-Wmissing-braces] suggest braces around initialization of subobject
13:38.73 warning: accessible/windows/msaa/CompatibilityUIA.cpp:172:44 [-Wunused-lambda-capture] lambda capture 'remotePid' is not required to be captured for th
is use
13:38.73 warning: accessible/windows/msaa/DocAccessibleWrap.cpp:38:1 [-Wunused-variable] unused variable 'hr'
13:38.73 warning: accessible/windows/msaa/EnumVariant.cpp:16:1 [-Wunused-variable] unused variable 'hr'
13:38.73 warning: accessible/windows/msaa/GeckoCustom.cpp:12:1 [-Wunused-variable] unused variable 'hr'
13:38.73 warning: accessible/windows/msaa/LazyInstantiator.cpp:405:1 [-Wunused-variable] unused variable 'hr'
13:38.73 warning: accessible/windows/msaa/ServiceProvider.cpp:24:1 [-Wunused-variable] unused variable 'hr'
13:38.73 warning: accessible/windows/msaa/TextLeafAccessibleWrap.cpp:14:1 [-Wunused-variable] unused variable 'hr'
13:38.73 warning: accessible/windows/sdn/sdnDocAccessible.cpp:21:1 [-Wunused-variable] unused variable 'hr'
13:38.73 warning: accessible/windows/sdn/sdnTextAccessible.cpp:29:1 [-Wunused-variable] unused variable 'hr'

I'll fix some of them which can be fixed quickly.
IMPL_IUNKNOWN_QUERY_HEAD defines HRESULT as hr.  However, if its user uses
IMPL_IUNKNOWN_QUERY_TAIL_AGGREGATED, it's never used.  Therefore, it causes
unused variable warning.  hr is defined with ATTRIBUTE_UNUSED.  However,
this is empty when built with clang.

IUnknownImpl.h already defines ATTRIBUTE_UNUSED as __attribute__((unused)) when
built with gcc.  So, same warnings should be prevented when built with clang
too.
In AccessibleWrap.cpp, VARIANT has a union member and initialized its instances
are initialized with {VT_I4}.  Looks like that clang does not allow to
initialize union member implicitly with initializing list without designator.
So, for avoiding warnings, this patch adds designator, |.vt =| before VT_I4.

In CompatibilityUIA, the capturing variable is reference to static variable.
So, this patch makes it refer the static variable directly.
Flags: needinfo?(aklotz)
Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/d0d1ccfded5d
part 1: Make IUnknownImpl.h define ATTRIBUTE_UNUSED as __attribute__((unused)) when built with clang r=Jamie
https://hg.mozilla.org/integration/autoland/rev/e61ca916da32
part 2: Fix simple warnings r=aklotz,Jamie
https://hg.mozilla.org/mozilla-central/rev/d0d1ccfded5d
https://hg.mozilla.org/mozilla-central/rev/e61ca916da32
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
You need to log in before you can comment on or make changes to this bug.