Commit a1b1b759 authored by Leszek Swirski's avatar Leszek Swirski Committed by V8 LUCI CQ

[gcc] More gcc build fixes

Fix some final gcc warnings:

  * Manually roll googletest to get the fix in:
    https://crrev.com/d5ad28dbe14fca51038fb8c7610f11602b98f682
  * Remove some anonymous namespaces in tests because the types in those
    anonymous namespaces ended up being visible in non-anonymous
    classes.
  * Fix a RVO breaking std::move.
  * Change some known-too-short strncpys into memcpys

Bug: chromium:1307180
Change-Id: I0f64512f77655f3740fc297bbb2087e6c039f7f3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3735122
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81436}
parent b2b14303
......@@ -238,7 +238,7 @@ deps = {
'url': Var('chromium_url') + '/external/github.com/google/benchmark.git' + '@' + 'b7afda2cd2d81230737caa1073e160b6406798d7',
},
'third_party/googletest/src':
Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + 'af29db7ec28d6df1c7f0f745186884091e602e07',
Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + '9406a60c7839052e4944ea4dbc8344762a89f9bd',
'third_party/icu':
Var('chromium_url') + '/chromium/deps/icu.git' + '@' + '50ec7b3822a90d73aa761b21fc941b485a1cb9d6',
'third_party/instrumented_libraries':
......
......@@ -168,9 +168,6 @@ TEST_F(InstructionSelectorTest, ChangeUint32ToFloat64WithParameter) {
// -----------------------------------------------------------------------------
// Loads and stores
namespace {
struct MemoryAccess {
MachineType type;
ArchOpcode load_opcode;
......@@ -193,8 +190,6 @@ static const MemoryAccess kMemoryAccesses[] = {
{MachineType::Float32(), kIA32Movss, kIA32Movss},
{MachineType::Float64(), kIA32Movsd, kIA32Movsd}};
} // namespace
using InstructionSelectorMemoryAccessTest =
InstructionSelectorTestWithParam<MemoryAccess>;
......@@ -475,9 +470,6 @@ TEST_F(AddressingModeUnitTest, AddressingMode_MI) {
// -----------------------------------------------------------------------------
// Multiplication.
namespace {
struct MultParam {
int value;
bool lea_expected;
......@@ -504,8 +496,6 @@ const MultParam kMultParams[] = {{-1, false, kMode_None},
{10, false, kMode_None},
{11, false, kMode_None}};
} // namespace
using InstructionSelectorMultTest = InstructionSelectorTestWithParam<MultParam>;
static unsigned InputCountForLea(AddressingMode mode) {
......
......@@ -301,7 +301,7 @@ cppgc::Persistent<GCedWithJSRef> SetupWrapperWrappablePair(
testing_scope.context(), &GCedWithJSRef::kWrappableType,
gc_w_js_ref.Get(), name);
gc_w_js_ref->SetV8Object(testing_scope.isolate(), wrapper_object);
return std::move(gc_w_js_ref);
return gc_w_js_ref;
}
template <typename Callback>
......
......@@ -389,8 +389,8 @@ TEST_F(ScannerStreamsTest, Utf8SingleByteChunks) {
char buffer[arraysize(unicode_utf8) + 4];
for (size_t i = 1; i < len - 1; i++) {
// Copy source string into buffer, make a single-byte chunk at i.
strncpy(buffer, unicode_utf8, i);
strncpy(buffer + i + 3, unicode_utf8 + i + 1, len - i - 1);
memcpy(buffer, unicode_utf8, i);
memcpy(buffer + i + 3, unicode_utf8 + i + 1, len - i - 1);
buffer[i] = '\0';
buffer[i + 1] = unicode_utf8[i];
buffer[i + 2] = '\0';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment