Last Comment Bug 785226 - warning spam: accessible/src/base/RoleMap.h:10:1: warning: comparison between 'enum mozilla::a11y::roles::Role' and 'enum nsIAccessibleRole::<anonymous>' [-Wenum-compare]
: warning spam: accessible/src/base/RoleMap.h:10:1: warning: comparison between...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Disability Access APIs (show other bugs)
: unspecified
: x86_64 Linux
: -- normal (vote)
: mozilla17
Assigned To: Nathan Froyd [:froydnj]
:
Mentors:
Depends on:
Blocks: 755048
  Show dependency treegraph
 
Reported: 2012-08-23 14:01 PDT by Nathan Froyd [:froydnj]
Modified: 2012-08-24 20:02 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (948 bytes, patch)
2012-08-23 14:03 PDT, Nathan Froyd [:froydnj]
dbolter: review+
Details | Diff | Review

Description Nathan Froyd [:froydnj] 2012-08-23 14:01:48 PDT
This warning is semi-annoying, seen under GCC.  Patch coming momentarily.
Comment 1 Nathan Froyd [:froydnj] 2012-08-23 14:03:57 PDT
Created attachment 654787 [details] [diff] [review]
patch

Simple patch.  I opted for casting to uint32_t rather than one or the other of the enums because I wasn't sure if casting to one of the enums might provoke weird behavior.
Comment 2 David Bolter [:davidb] 2012-08-23 14:11:59 PDT
Comment on attachment 654787 [details] [diff] [review]
patch

Review of attachment 654787 [details] [diff] [review]:
-----------------------------------------------------------------

I'm fine with this but I'm hoping Trevor is as well.
Comment 3 Trevor Saunders (:tbsaunde) 2012-08-23 14:21:09 PDT
Comment on attachment 654787 [details] [diff] [review]
patch

> #define ROLE(geckoRole, stringRole, atkRole, macRole, msaaRole, ia2Role, nameRule) \
>-  MOZ_STATIC_ASSERT(roles::geckoRole == nsIAccessibleRole::ROLE_ ## geckoRole, "internal and xpcom roles differ!");
>+  MOZ_STATIC_ASSERT(static_cast<uint32_t>(roles::geckoRole) == static_cast<uint32_t>(nsIAccessibleRole::ROLE_ ## geckoRole), \
>+                    "internal and xpcom roles differ!");

nit, you break 80 char restriction.

otherwise seems fine.
Comment 4 Nathan Froyd [:froydnj] 2012-08-24 08:41:17 PDT
(In reply to Trevor Saunders (:tbsaunde) from comment #3)
> > #define ROLE(geckoRole, stringRole, atkRole, macRole, msaaRole, ia2Role, nameRule) \
> >-  MOZ_STATIC_ASSERT(roles::geckoRole == nsIAccessibleRole::ROLE_ ## geckoRole, "internal and xpcom roles differ!");
> >+  MOZ_STATIC_ASSERT(static_cast<uint32_t>(roles::geckoRole) == static_cast<uint32_t>(nsIAccessibleRole::ROLE_ ## geckoRole), \
> >+                    "internal and xpcom roles differ!");
> 
> nit, you break 80 char restriction.

I wrapped the equality check; it still breaks 80 chars, but the added line is shorter than the #define (which already breaks the restriction), I don't feel too bad about this.

https://hg.mozilla.org/integration/mozilla-inbound/rev/8aa9e479b24f
Comment 5 Ryan VanderMeulen [:RyanVM] 2012-08-24 20:02:37 PDT
https://hg.mozilla.org/mozilla-central/rev/8aa9e479b24f

Note You need to log in before you can comment on or make changes to this bug.