Build warning: "TestObserverArray.cpp:90:123: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]"

RESOLVED FIXED in mozilla11

Status

()

Core
XPCOM
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: dholbert, Assigned: Atul Aggarwal)

Tracking

(Blocks: 1 bug)

Trunk
mozilla11
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [build_warning] )

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
When building mozilla-central with g++ 4.5, I get the following build-spew when I hit TestObserverArray.cpp:
> xpcom/tests/TestObserverArray.cpp:89:43: warning: invoking macro DO_TEST argument 3: empty macro arguments are undefined in ISO C90 and ISO C++98
> xpcom/tests/TestObserverArray.cpp:96:43: warning: invoking macro DO_TEST argument 3: empty macro arguments are undefined in ISO C90 and ISO C++98
> xpcom/tests/TestObserverArray.cpp:103:43: warning: invoking macro DO_TEST argument 3: empty macro arguments are undefined in ISO C90 and ISO C++98
> xpcom/tests/TestObserverArray.cpp:111:43: warning: invoking macro DO_TEST argument 3: empty macro arguments are undefined in ISO C90 and ISO C++98
> xpcom/tests/TestObserverArray.cpp:117:43: warning: invoking macro DO_TEST argument 3: empty macro arguments are undefined in ISO C90 and ISO C++98
> xpcom/tests/TestObserverArray.cpp:122:44: warning: invoking macro DO_TEST argument 3: empty macro arguments are undefined in ISO C90 and ISO C++98
> xpcom/tests/TestObserverArray.cpp:125:44: warning: invoking macro DO_TEST argument 3: empty macro arguments are undefined in ISO C90 and ISO C++98
> xpcom/tests/TestObserverArray.cpp:131:44: warning: invoking macro DO_TEST argument 3: empty macro arguments are undefined in ISO C90 and ISO C++98
> xpcom/tests/TestObserverArray.cpp:141:44: warning: invoking macro DO_TEST argument 3: empty macro arguments are undefined in ISO C90 and ISO C++98
> xpcom/tests/TestObserverArray.cpp:145:44: warning: invoking macro DO_TEST argument 3: empty macro arguments are undefined in ISO C90 and ISO C++98
> xpcom/tests/TestObserverArray.cpp:156:44: warning: invoking macro DO_TEST argument 3: empty macro arguments are undefined in ISO C90 and ISO C++98
> xpcom/tests/TestObserverArray.cpp:161:44: warning: invoking macro DO_TEST argument 3: empty macro arguments are undefined in ISO C90 and ISO C++98
> xpcom/tests/TestObserverArray.cpp:164:44: warning: invoking macro DO_TEST argument 3: empty macro arguments are undefined in ISO C90 and ISO C++98

Updated

6 years ago
Blocks: 187528
(Assignee)

Comment 1

6 years ago
Created attachment 572301 [details] [diff] [review]
Patch v1

This patch removes 55 lines of warnings.
Assignee: nobody → atulagrwl
Status: NEW → ASSIGNED
Attachment #572301 - Flags: review?(jones.chris.g)
(Assignee)

Comment 2

6 years ago
All warnings are like:
/mozilla/mozilla-central/xpcom/tests/TestObserverArray.cpp:90:123: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/mozilla/mozilla-central/xpcom/tests/TestTArray.cpp:661:248: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 7 has type ‘size_t {aka long unsigned int}’ [-Wformat]
(Reporter)

Comment 3

6 years ago
Note that this bug was about a different set of warnings (in this same file).

However, from looking at a recent build log[1], it looks like Comment 0's warnings have been resolved, so I'm happy to have this bug be about the warnings in Comment 2 now.

[1] https://tbpl.mozilla.org/php/getParsedLog.php?id=7240706&tree=Firefox
Summary: 13 instances of "TestObserverArray.cpp:89:43: warning: invoking macro DO_TEST argument 3: empty macro arguments are undefined in ISO C90 and ISO C++98" → Build warning: "TestObserverArray.cpp:90:123: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]"
Comment on attachment 572301 [details] [diff] [review]
Patch v1

This is OK, but just FYI, the standard C way to printf() size_t is with the "%z" format specifier, which of course MSVC doesn't support :/.
Attachment #572301 - Flags: review?(jones.chris.g) → review+
(Assignee)

Updated

6 years ago
Keywords: checkin-needed
Whiteboard: [build_warning] → [build_warning]
http://hg.mozilla.org/integration/mozilla-inbound/rev/1145823819dc
Keywords: checkin-needed
Target Milestone: --- → mozilla11

Comment 6

6 years ago
https://hg.mozilla.org/mozilla-central/rev/1145823819dc
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.