Closed Bug 630290 Opened 14 years ago Closed 13 years ago

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

Categories

(Core :: XPCOM, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla11

People

(Reporter: dholbert, Assigned: atulagrwl)

References

(Blocks 1 open bug)

Details

(Whiteboard: [build_warning] )

Attachments

(1 file)

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
Blocks: buildwarning
Attached patch Patch v1Splinter Review
This patch removes 55 lines of warnings.
Assignee: nobody → atulagrwl
Status: NEW → ASSIGNED
Attachment #572301 - Flags: review?(jones.chris.g)
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]
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+
Keywords: checkin-needed
Whiteboard: [build_warning] → [build_warning]
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: