Reviewers: Sven Panne,

Message:
No idea why these checks are causing warnings and the above "if (value==0) {}"
check isn't, but so it is.

In file included from .././src/checks.h:9:0,
                 from .././src/v8.h:31,
                 from ../src/deoptimizer.cc:5:
.././src/base/logging.h: In instantiation of ‘std::string*
v8::base::CheckEQImpl(const Lhs&, const Rhs&, const char*) [with Lhs = int; Rhs
= long unsigned int; std::string = std::basic_string<char>]’:
../src/deoptimizer.cc:2370:101:   required from here
.././src/base/logging.h:123:154: error: comparison between signed and unsigned
integer expressions [-Werror=sign-compare]
 DEFINE_CHECK_OP_IMPL(EQ, ==)

                                                                         ^
cc1plus: error: unrecognized command line option "-Wno-format-pedantic"
[-Werror]
cc1plus: all warnings being treated as errors


Description:
Fix -Wsign-compare bugs with GCC 4.9.2

[email protected]
LOG=N
BUG=

Please review this at https://codereview.chromium.org/1105653002/

Base URL: https://chromium.googlesource.com/v8/v8@master

Affected files (+6, -6 lines):
  M src/compiler/register-allocator.cc
  M src/deoptimizer.cc


Index: src/compiler/register-allocator.cc
diff --git a/src/compiler/register-allocator.cc b/src/compiler/register-allocator.cc index dd526cd47b88bcdcd274ef235d26867e3e88668a..28007d47fa11aadc60c0781e3793d76a13d39880 100644
--- a/src/compiler/register-allocator.cc
+++ b/src/compiler/register-allocator.cc
@@ -2218,7 +2218,7 @@ float GreedyAllocator::CalculateSpillWeight(LiveRange* range) {

   // GetLiveRangeSize is DCHECK-ed to not be 0
   unsigned range_size = GetLiveRangeSize(range);
-  DCHECK_NE(0, range_size);
+  DCHECK_NE(0U, range_size);

   return static_cast<float>(use_count) / static_cast<float>(range_size);
 }
Index: src/deoptimizer.cc
diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc
index 1f32f1c2bf37581a76609c0b0ddf90bdacb9a9e6..13c282da9e6a8a4058dc084eb974ad72118f4b8a 100644
--- a/src/deoptimizer.cc
+++ b/src/deoptimizer.cc
@@ -2257,7 +2257,7 @@ void Deoptimizer::DoTranslateObject(TranslationIterator* iterator,
         AddObjectTaggedValue(
             reinterpret_cast<intptr_t>(isolate_->heap()->false_value()));
       } else {
-        DCHECK_EQ(1, value);
+        DCHECK_EQ(1U, value);
         AddObjectTaggedValue(
             reinterpret_cast<intptr_t>(isolate_->heap()->true_value()));
       }
@@ -2367,7 +2367,7 @@ void Deoptimizer::DoTranslateObject(TranslationIterator* iterator,
         AddObjectTaggedValue(
             reinterpret_cast<intptr_t>(isolate_->heap()->false_value()));
       } else {
-        DCHECK_EQ(1, value);
+        DCHECK_EQ(1U, value);
         AddObjectTaggedValue(
             reinterpret_cast<intptr_t>(isolate_->heap()->true_value()));
       }
@@ -2573,7 +2573,7 @@ void Deoptimizer::DoTranslateCommand(TranslationIterator* iterator,
             output_offset,
             reinterpret_cast<intptr_t>(isolate_->heap()->false_value()));
       } else {
-        DCHECK_EQ(1, value);
+        DCHECK_EQ(1U, value);
         output_[frame_index]->SetFrameSlot(
             output_offset,
             reinterpret_cast<intptr_t>(isolate_->heap()->true_value()));
@@ -2699,7 +2699,7 @@ void Deoptimizer::DoTranslateCommand(TranslationIterator* iterator,
             output_offset,
             reinterpret_cast<intptr_t>(isolate_->heap()->false_value()));
       } else {
-        DCHECK_EQ(1, value);
+        DCHECK_EQ(1U, value);
         output_[frame_index]->SetFrameSlot(
             output_offset,
             reinterpret_cast<intptr_t>(isolate_->heap()->true_value()));
@@ -3456,7 +3456,7 @@ Handle<Object> SlotRef::GetValue(Isolate* isolate) {
       if (value == 0) {
         return isolate->factory()->false_value();
       } else {
-        DCHECK_EQ(1, value);
+        DCHECK_EQ(1U, value);
         return isolate->factory()->true_value();
       }
     }


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to