Closed
Bug 997306
Opened 10 years ago
Closed 10 years ago
TestGCPostBarriers.cpp:58:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare], and many more
Categories
(Core :: JavaScript: GC, defect)
Core
JavaScript: GC
Tracking
()
RESOLVED
FIXED
mozilla31
People
(Reporter: dholbert, Assigned: dholbert)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
1.96 KB,
patch
|
jonco
:
review+
|
Details | Diff | Splinter Review |
I noticed these 57 lines go by in my buildspew today, for TestGCPostBarriers.cpp: { 3:11.17 In file included from $OBJDIR/xpcom/glue/tests/gtest/Unified_cpp_glue_tests_gtest0.cpp:15: 3:11.17 Warning: -Wsign-compare in $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') 3:11.17 $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp:58:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare] 3:11.17 for (int i = 0; i < ElementCount; ++i) { 3:11.17 ~ ^ ~~~~~~~~~~~~ 3:11.17 Warning: -Wsign-compare in $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') 3:11.17 $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp:79:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare] 3:11.17 for (int i = 0; i < ElementCount; ++i) { 3:11.17 ~ ^ ~~~~~~~~~~~~ 3:11.18 TestComponent.o 3:11.18 nsEnumeratorUtils.o 3:11.27 Warning: -Wsign-compare in $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') 3:11.27 $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp:58:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare] 3:11.27 for (int i = 0; i < ElementCount; ++i) { 3:11.27 ~ ^ ~~~~~~~~~~~~ 3:11.27 $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp:113:5: note: in instantiation of function template specialization 'RunTest<nsTArray<JS::Heap<JSObject *> > >' requested here 3:11.27 RunTest(rt, cx, array); 3:11.27 ^ 3:11.27 Warning: -Wsign-compare in $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') 3:11.27 $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp:79:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare] 3:11.27 for (int i = 0; i < ElementCount; ++i) { 3:11.27 ~ ^ ~~~~~~~~~~~~ 3:11.27 TestComponent.o 3:11.28 Warning: -Wsign-compare in $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') 3:11.28 $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp:58:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare] 3:11.28 for (int i = 0; i < ElementCount; ++i) { 3:11.28 ~ ^ ~~~~~~~~~~~~ 3:11.28 $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp:119:5: note: in instantiation of function template specialization 'RunTest<FallibleTArray<JS::Heap<JSObject *> > >' requested here 3:11.28 RunTest(rt, cx, array); 3:11.28 ^ 3:11.28 Warning: -Wsign-compare in $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') 3:11.28 $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp:79:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare] 3:11.28 for (int i = 0; i < ElementCount; ++i) { 3:11.28 ~ ^ ~~~~~~~~~~~~ 3:11.28 nsTestSample.o 3:11.28 Warning: -Wsign-compare in $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') 3:11.28 $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp:58:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare] 3:11.28 for (int i = 0; i < ElementCount; ++i) { 3:11.28 ~ ^ ~~~~~~~~~~~~ 3:11.28 $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp:125:5: note: in instantiation of function template specialization 'RunTest<nsAutoTArray<JS::Heap<JSObject *>, 10> >' requested here 3:11.28 RunTest(rt, cx, &array); 3:11.28 ^ 3:11.29 Warning: -Wsign-compare in $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') 3:11.29 $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp:79:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare] 3:11.29 for (int i = 0; i < ElementCount; ++i) { 3:11.29 ~ ^ ~~~~~~~~~~~~ 3:11.29 Warning: -Wsign-compare in $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') 3:11.29 $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp:58:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare] 3:11.29 for (int i = 0; i < ElementCount; ++i) { 3:11.29 ~ ^ ~~~~~~~~~~~~ 3:11.29 $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp:130:5: note: in instantiation of function template specialization 'RunTest<AutoFallibleTArray<JS::Heap<JSObject *>, 10> >' requested here 3:11.29 RunTest(rt, cx, &array); 3:11.29 ^ 3:11.29 Warning: -Wsign-compare in $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') 3:11.29 $SRCDIR/xpcom/glue/tests/gtest/TestGCPostBarriers.cpp:79:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare] 3:11.29 for (int i = 0; i < ElementCount; ++i) { 3:11.29 ~ ^ ~~~~~~~~~~~~ } Looks like Bug 993410 introduced 'ElementCount' and made these comparisons into signed/unsigned comparisons; hence, setting as blocking that bug. (I'm building with clang 3.4 on linux, if it matters -- though I think all compilers should warn about this.)
Assignee | ||
Comment 1•10 years ago
|
||
This patch makes the test compile with no warnings for me.
Assignee | ||
Comment 2•10 years ago
|
||
[minor tweak: changed my static_cast to use int32_t instead of int, to match the return-type of value.toInt32().]
Attachment #8407687 -
Attachment is obsolete: true
Attachment #8407687 -
Flags: review?(jcoppeard)
Attachment #8407692 -
Flags: review?(jcoppeard)
Comment 3•10 years ago
|
||
Comment on attachment 8407692 [details] [diff] [review] fix v2 Review of attachment 8407692 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for fixing this!
Attachment #8407692 -
Flags: review?(jcoppeard) → review+
Assignee | ||
Comment 4•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/1ee7dd06327f
Flags: in-testsuite-
Comment 5•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/1ee7dd06327f
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in
before you can comment on or make changes to this bug.
Description
•