Skip to content

Commit 74b93d1

Browse files
Explicit (void*) for non-trivial memset
first argument in call to 'memset' is a pointer to non-trivially copyable type [-Wnontrivial-memcall]
1 parent 3d35b0f commit 74b93d1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+79
-73
lines changed

bin/GCStress/GCStress.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class Location
148148
VerifyCondition(found);
149149

150150
// Zero pointers in order to eliminate false-positives
151-
memset(holder, 0, heapObject.GetSize());
151+
memset((void*)holder, 0, heapObject.GetSize());
152152

153153
bool success = heapObject.ClearImplicitRootBit();
154154
VerifyCondition(success);

bin/rl/rl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4345,7 +4345,7 @@ ProcessConfig
43454345
// Get the defaults from the default node.
43464346

43474347
TestInfo testInfo;
4348-
memset(&testInfo, 0, sizeof(TestInfo));
4348+
memset((void*)&testInfo, 0, sizeof(TestInfo));
43494349

43504350
if (!GetTestInfoFromNode(CfgFile, defaultNode, &testInfo))
43514351
{

bin/rl/rl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ class WorkQueue {
472472
/*
473473
* Create the semaphores for the work lists
474474
*/
475-
memset(&sa, 0, sizeof(sa));
475+
memset((void*)&sa, 0, sizeof(sa));
476476
sa.nLength = sizeof(sa);
477477
sa.lpSecurityDescriptor = NULL;
478478
sa.bInheritHandle = TRUE;

bin/rl/rlfeint.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ SpawnRLFE(
7373
if (NULStdout == INVALID_HANDLE_VALUE)
7474
goto cleanup;
7575

76-
memset(&si, 0, sizeof(si));
76+
memset((void*)&si, 0, sizeof(si));
7777
si.cb = sizeof(si);
7878
si.dwFlags = STARTF_USESTDHANDLES;
7979
si.hStdOutput = NULStdout;

bin/rl/rlmp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,14 +823,14 @@ PipeSpawn(
823823
return NULL;
824824
}
825825

826-
memset(&StartupInfo, 0, sizeof(STARTUPINFO));
826+
memset((void*)&StartupInfo, 0, sizeof(STARTUPINFO));
827827
StartupInfo.cb = sizeof(STARTUPINFO);
828828
StartupInfo.hStdOutput = WriteHandle;
829829
StartupInfo.hStdError = ErrorHandle;
830830
StartupInfo.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
831831
StartupInfo.dwFlags = STARTF_USESTDHANDLES;
832832

833-
memset(&ProcessInformation, 0, sizeof(PROCESS_INFORMATION));
833+
memset((void*)&ProcessInformation, 0, sizeof(PROCESS_INFORMATION));
834834
ProcessInformation.hThread = INVALID_HANDLE_VALUE;
835835
ProcessInformation.hProcess = INVALID_HANDLE_VALUE;
836836

lib/Backend/CodeGenNumberAllocator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ Js::JavascriptNumber* XProcNumberPageSegmentImpl::AllocateNumber(Func* func, dou
396396

397397
XProcNumberPageSegmentImpl::XProcNumberPageSegmentImpl()
398398
{
399-
memset(this, 0, sizeof(XProcNumberPageSegment));
399+
memset((void*)this, 0, sizeof(XProcNumberPageSegment));
400400
}
401401

402402
void XProcNumberPageSegmentImpl::Initialize(bool recyclerVerifyEnabled, uint recyclerVerifyPad)

lib/Backend/Peeps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Peeps::PeepFunc()
2626
this->peepsMD.Init(this);
2727

2828
// Init regMap
29-
memset(this->regMap, 0, sizeof(this->regMap));
29+
memset((void*)this->regMap, 0, sizeof(this->regMap));
3030

3131
// Scratch field needs to be cleared.
3232
this->func->m_symTable->ClearStackSymScratch();

lib/Backend/SymTable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ SymTable::ClearStackSymScratch()
287287
{
288288
if (sym->IsStackSym())
289289
{
290-
memset(&(sym->AsStackSym()->scratch), 0, sizeof(sym->AsStackSym()->scratch));
290+
memset((void*)&(sym->AsStackSym()->scratch), 0, sizeof(sym->AsStackSym()->scratch));
291291
}
292292
} NEXT_SYM_IN_TABLE;
293293
}

lib/Backend/amd64/LinearScanMD.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//-------------------------------------------------------------------------------------------------------
22
// Copyright (C) Microsoft. All rights reserved.
3+
// Copyright (c) ChakraCore Project Contributors. All rights reserved.
34
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
45
//-------------------------------------------------------------------------------------------------------
56
#include "Backend.h"
@@ -22,9 +23,9 @@ LinearScanMD::LinearScanMD(Func *func)
2223
}
2324
} NEXT_REG;
2425

25-
memset(this->xmmSymTable128, 0, sizeof(this->xmmSymTable128));
26-
memset(this->xmmSymTable64, 0, sizeof(this->xmmSymTable64));
27-
memset(this->xmmSymTable32, 0, sizeof(this->xmmSymTable32));
26+
memset((void*)this->xmmSymTable128, 0, sizeof(this->xmmSymTable128));
27+
memset((void*)this->xmmSymTable64, 0, sizeof(this->xmmSymTable64));
28+
memset((void*)this->xmmSymTable32, 0, sizeof(this->xmmSymTable32));
2829
}
2930

3031
BitVector

lib/Backend/arm/LinearScanMD.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ LinearScanMD::Init(LinearScan *linearScan)
2525
func->m_regsUsed.Set(localsReg);
2626
}
2727

28-
memset(this->vfpSymTable, 0, sizeof(this->vfpSymTable));
28+
memset((void*)this->vfpSymTable, 0, sizeof(this->vfpSymTable));
2929
}
3030

3131
StackSym *

0 commit comments

Comments
 (0)