Fix compile warning - TestObserverArray.cpp:45:1: warning: "NS_ARRAY_LENGTH" redefined

RESOLVED FIXED

Status

()

RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [build_warning])

Attachments

(1 attachment)

(Assignee)

Description

9 years ago
I get this compile warning when building mozilla-central on linux:

>../../../mozilla/xpcom/tests/TestObserverArray.cpp:45:1: warning: "NS_ARRAY_LENGTH" redefined
>In file included from ../../dist/include/nsString.h:209,
>                 from ../../dist/include/nsStringGlue.h:49,
>                 from ../../../mozilla/xpcom/tests/TestHarness.h:51,
>                 from ../../../mozilla/xpcom/tests/TestObserverArray.cpp:40:
>../../dist/include/nsMemory.h:156:1: warning: this is the location of the previous definition

For some reason, TestObserverArray.cpp has its own personal declaration of NS_ARRAY_LENGTH.  It's effectively the same as the one in nsMemory.h. (The only difference is use of "*" vs "[0]" to get the size of the first array-element). The version in TestObserverArray.cpp should just be removed.
(Assignee)

Comment 1

9 years ago
Created attachment 432491 [details] [diff] [review]
fix

Presumably at some point since this test was checked in, it got an indirect #include of nsMemory.h.  (I assume that was the reason we directly included NS_ARRAY_LENGTH in the test in the first place.)

I'm including a direct #include just for good measure, in case the fortuitous indirect #include chain gets broken later on.

bz, mind rubber-stamping this tweak to your test?
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #432491 - Flags: review?(bzbarsky)
(Assignee)

Comment 3

9 years ago
Thanks! pushed: http://hg.mozilla.org/mozilla-central/rev/4ad695657131
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
(Assignee)

Updated

9 years ago
Whiteboard: [build_warning]
You need to log in before you can comment on or make changes to this bug.