1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-25 09:34:11 +00:00

- Fix warnings generated by recent snapshot of Clang 3.7.0, including:

- Printing non-void pointers with %p.
  - Left-shifting negative numbers.

PR:		202530
Submitted by:	dim
This commit is contained in:
Sunpoet Po-Chuan Hsieh 2015-09-20 20:17:28 +00:00
parent 74da15791a
commit 202993b050
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=397412
7 changed files with 107 additions and 0 deletions

View File

@ -0,0 +1,11 @@
--- src/checks.h.orig 2013-05-01 12:56:29 UTC
+++ src/checks.h
@@ -248,7 +248,7 @@ template <int> class StaticAssertionHelp
#define STATIC_CHECK(test) \
typedef \
StaticAssertionHelper<sizeof(StaticAssertion<static_cast<bool>((test))>)> \
- SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__)
+ SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__) __attribute__((__unused__))
extern bool FLAG_enable_slow_asserts;

View File

@ -0,0 +1,29 @@
--- src/deoptimizer.cc.orig 2013-05-01 12:56:29 UTC
+++ src/deoptimizer.cc
@@ -1392,7 +1392,7 @@ void Deoptimizer::MaterializeHeapObjects
PrintF("Materializing a new heap number %p [%e] in slot %p\n",
reinterpret_cast<void*>(*num),
d.value(),
- d.slot_address());
+ reinterpret_cast<void*>(d.slot_address()));
}
Memory::Object_at(d.slot_address()) = *num;
}
@@ -1474,7 +1474,7 @@ void Deoptimizer::MaterializeHeapNumbers
"for parameter slot #%d\n",
reinterpret_cast<void*>(*num),
d.value(),
- d.slot_address(),
+ reinterpret_cast<void*>(d.slot_address()),
index);
}
@@ -1490,7 +1490,7 @@ void Deoptimizer::MaterializeHeapNumbers
"for expression slot #%d\n",
reinterpret_cast<void*>(*num),
d.value(),
- d.slot_address(),
+ reinterpret_cast<void*>(d.slot_address()),
index);
}

View File

@ -0,0 +1,11 @@
--- src/ia32/code-stubs-ia32.cc.orig 2013-05-01 12:56:29 UTC
+++ src/ia32/code-stubs-ia32.cc
@@ -5650,7 +5650,7 @@ void StringCharFromCodeGenerator::Genera
ASSERT(IsPowerOf2(String::kMaxOneByteCharCode + 1));
__ test(code_,
Immediate(kSmiTagMask |
- ((~String::kMaxOneByteCharCode) << kSmiTagSize)));
+ ((~String::kMaxOneByteCharCodeU) << kSmiTagSize)));
__ j(not_zero, &slow_case_);
Factory* factory = masm->isolate()->factory();

View File

@ -0,0 +1,11 @@
--- src/ia32/disasm-ia32.cc.orig 2013-05-01 12:56:29 UTC
+++ src/ia32/disasm-ia32.cc
@@ -1707,7 +1707,7 @@ int Disassembler::ConstantPoolSizeAt(byt
buffer[0] = '\0';
byte* prev_pc = pc;
pc += d.InstructionDecode(buffer, pc);
- fprintf(f, "%p", prev_pc);
+ fprintf(f, "%p", reinterpret_cast<void*>(prev_pc));
fprintf(f, " ");
for (byte* bp = prev_pc; bp < pc; bp++) {

View File

@ -0,0 +1,12 @@
--- src/ia32/ic-ia32.cc.orig 2013-05-01 12:56:29 UTC
+++ src/ia32/ic-ia32.cc
@@ -1657,7 +1657,8 @@ void PatchInlinedSmiCode(Address address
int8_t delta = *reinterpret_cast<int8_t*>(delta_address);
if (FLAG_trace_ic) {
PrintF("[ patching ic at %p, test=%p, delta=%d\n",
- address, test_instruction_address, delta);
+ reinterpret_cast<void*>(address),
+ reinterpret_cast<void*>(test_instruction_address), delta);
}
// Patch with a short conditional jump. Enabling means switching from a short

View File

@ -0,0 +1,11 @@
--- src/liveedit.cc.orig 2013-05-01 12:56:29 UTC
+++ src/liveedit.cc
@@ -203,7 +203,7 @@ class Differencer {
static const int kDirectionSizeBits = 2;
static const int kDirectionMask = (1 << kDirectionSizeBits) - 1;
- static const int kEmptyCellValue = -1 << kDirectionSizeBits;
+ static const int kEmptyCellValue = -(1 << kDirectionSizeBits);
// This method only holds static assert statement (unfortunately you cannot
// place one in class scope).

View File

@ -0,0 +1,22 @@
--- src/objects.h.orig 2013-05-01 12:56:29 UTC
+++ src/objects.h
@@ -5573,7 +5573,7 @@ class Map: public HeapObject {
static const int kElementsKindBitCount = 5;
// Derived values from bit field 2
- static const int kElementsKindMask = (-1 << kElementsKindShift) &
+ static const int kElementsKindMask = -(1 << kElementsKindShift) &
((1 << (kElementsKindShift + kElementsKindBitCount)) - 1);
static const int8_t kMaximumBitField2FastElementValue = static_cast<int8_t>(
(FAST_ELEMENTS + 1) << Map::kElementsKindShift) - 1;
@@ -7580,8 +7580,8 @@ class Name: public HeapObject {
STATIC_CHECK(IS_POWER_OF_TWO(kMaxCachedArrayIndexLength + 1));
static const int kContainsCachedArrayIndexMask =
- (~kMaxCachedArrayIndexLength << kArrayIndexHashLengthShift) |
- kIsNotArrayIndexMask;
+ (~static_cast<unsigned>(kMaxCachedArrayIndexLength) <<
+ kArrayIndexHashLengthShift) | kIsNotArrayIndexMask;
// Value of empty hash field indicating that the hash is not computed.
static const int kEmptyHashField =