The default bug view has changed. See this FAQ.

warning spam: accessible/src/base/RoleMap.h:10:1: warning: comparison between 'enum mozilla::a11y::roles::Role' and 'enum nsIAccessibleRole::<anonymous>' [-Wenum-compare]

RESOLVED FIXED in mozilla17

Status

()

Core
Disability Access APIs
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: froydnj, Assigned: froydnj)

Tracking

unspecified
mozilla17
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
This warning is semi-annoying, seen under GCC.  Patch coming momentarily.
(Assignee)

Comment 1

5 years ago
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.
Attachment #654787 - Flags: review?(dbolter)
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.
Attachment #654787 - Flags: review?(trev.saunders)
Attachment #654787 - Flags: review?(dbolter)
Attachment #654787 - Flags: review+
Component: General → Disability Access APIs
Assignee: nobody → nfroyd
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.
Attachment #654787 - Flags: review?(trev.saunders)
(Assignee)

Comment 4

5 years ago
(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
Status: NEW → ASSIGNED
https://hg.mozilla.org/mozilla-central/rev/8aa9e479b24f
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
You need to log in before you can comment on or make changes to this bug.