Closed Bug 785226 Opened 12 years ago Closed 12 years ago

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

Categories

(Core :: Disability Access APIs, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla17

People

(Reporter: froydnj, Assigned: froydnj)

References

Details

Attachments

(1 file)

This warning is semi-annoying, seen under GCC.  Patch coming momentarily.
Attached patch patchSplinter Review
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)
(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
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: