Last Comment Bug 630290 - Build warning: "TestObserverArray.cpp:90:123: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]"
: Build warning: "TestObserverArray.cpp:90:123: warning: comparison between sig...
Status: RESOLVED FIXED
[build_warning]
:
Product: Core
Classification: Components
Component: XPCOM (show other bugs)
: Trunk
: x86_64 Linux
: -- normal (vote)
: mozilla11
Assigned To: Atul Aggarwal
:
Mentors:
Depends on:
Blocks: buildwarning
  Show dependency treegraph
 
Reported: 2011-01-31 12:04 PST by Daniel Holbert [:dholbert]
Modified: 2012-02-01 13:56 PST (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (1.76 KB, patch)
2011-11-06 07:48 PST, Atul Aggarwal
cjones.bugs: review+
Details | Diff | Splinter Review

Description Daniel Holbert [:dholbert] 2011-01-31 12:04:07 PST
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
Comment 1 Atul Aggarwal 2011-11-06 07:48:40 PST
Created attachment 572301 [details] [diff] [review]
Patch v1

This patch removes 55 lines of warnings.
Comment 2 Atul Aggarwal 2011-11-06 07:49:38 PST
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]
Comment 3 Daniel Holbert [:dholbert] 2011-11-06 13:28:19 PST
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
Comment 4 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2011-11-07 20:19:27 PST
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 :/.
Comment 6 Ed Morley [:emorley] 2011-11-19 05:14:22 PST
https://hg.mozilla.org/mozilla-central/rev/1145823819dc

Note You need to log in before you can comment on or make changes to this bug.