summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt42
-rw-r--r--src/debug/ee/debugger.cpp2
-rw-r--r--src/gc/gc.cpp16
-rw-r--r--src/inc/arraylist.h2
-rw-r--r--src/inc/complex.h2
-rw-r--r--src/md/enc/metamodelrw.cpp2
-rw-r--r--src/pal/inc/pal.h3
-rw-r--r--src/pal/inc/pal_char16.h2
-rw-r--r--src/vm/amd64/unixstubs.cpp4
-rw-r--r--src/vm/amd64/virtualcallstubcpu.hpp2
-rw-r--r--src/vm/corhost.cpp2
-rw-r--r--src/vm/exceptionhandling.cpp4
-rw-r--r--src/vm/gcstress.h6
-rw-r--r--src/vm/methodtable.cpp7
-rw-r--r--src/vm/multicorejit.cpp7
-rw-r--r--src/vm/syncblk.cpp4
-rw-r--r--src/vm/threadsuspend.cpp6
17 files changed, 69 insertions, 44 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e7e944652d..c7f55e693e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -203,10 +203,44 @@ add_definitions(-DDISABLE_CONTRACTS)
# The -ferror-limit is helpful during the porting, it makes sure the compiler doesn't stop
# after hitting just about 20 errors.
add_compile_options(-ferror-limit=4096)
-# The -w option disables warnings for now, there are hundreds of them and it is hard to
-# find the errors in the output. We need to reenable them later though to make sure we don't`
-# miss any real issues.
-add_compile_options(-w)
+
+# Disabled warnings
+add_compile_options(-Wno-reorder)
+add_compile_options(-Wno-ignored-attributes)
+add_compile_options(-Wno-unknown-pragmas)
+add_compile_options(-Wno-unused-private-field)
+add_compile_options(-Wno-new-returns-null)
+add_compile_options(-Wno-dangling-else)
+add_compile_options(-Wno-implicit-exception-spec-mismatch)
+add_compile_options(-Wno-deprecated-register)
+add_compile_options(-Wno-parentheses)
+add_compile_options(-Wno-overloaded-virtual)
+add_compile_options(-Wno-unused-variable)
+add_compile_options(-Wno-missing-declarations)
+add_compile_options(-Wno-switch)
+add_compile_options(-Wno-extern-initializer)
+add_compile_options(-Wno-microsoft)
+add_compile_options(-Wno-mismatched-tags)
+add_compile_options(-Wno-ignored-qualifiers)
+add_compile_options(-Wno-tautological-constant-out-of-range-compare)
+add_compile_options(-Wno-c++11-compat-deprecated-writable-strings)
+add_compile_options(-Wno-unneeded-internal-declaration)
+add_compile_options(-Wno-tautological-compare)
+add_compile_options(-Wno-constant-logical-operand)
+add_compile_options(-Wno-unused-function)
+add_compile_options(-Wno-extra-tokens)
+add_compile_options(-Wno-self-assign)
+add_compile_options(-Wno-bitfield-constant-conversion)
+add_compile_options(-Wno-unused-value)
+
+#These seem to indicate real issues
+add_compile_options(-Wno-invalid-offsetof)
+add_compile_options(-Wno-return-type)
+add_compile_options(-Wno-dynamic-class-memaccess)
+add_compile_options(-Wno-int-to-pointer-cast)
+add_compile_options(-Wno-delete-non-virtual-dtor)
+add_compile_options(-Wno-enum-compare)
+
# The -fms-extensions enable the stuff like __if_exists, __declspec(uuid()), etc.
add_compile_options(-fms-extensions )
#-fms-compatibility Enable full Microsoft Visual C++ compatibility
diff --git a/src/debug/ee/debugger.cpp b/src/debug/ee/debugger.cpp
index 5b961a2b7e..723c662b18 100644
--- a/src/debug/ee/debugger.cpp
+++ b/src/debug/ee/debugger.cpp
@@ -10765,7 +10765,7 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent)
// If we need to fault, let's generate an access violation.
if (s_fDbgFaultInHandleIPCEvent)
{
- *((BYTE *)0) = 0;
+ *((volatile BYTE *)0) = 0;
}
#endif
diff --git a/src/gc/gc.cpp b/src/gc/gc.cpp
index e0cd018cfe..e063491fbb 100644
--- a/src/gc/gc.cpp
+++ b/src/gc/gc.cpp
@@ -5796,7 +5796,7 @@ inline
BOOL grow_mark_stack (mark*& m, size_t& len, size_t init_len)
{
size_t new_size = max (init_len, 2*len);
- mark* tmp = new (nothrow) (mark [new_size]);
+ mark* tmp = new (nothrow) mark [new_size];
if (tmp)
{
memcpy (tmp, m, len * sizeof (mark));
@@ -8125,7 +8125,7 @@ public:
MAX_NUM_BUCKETS * sizeof (free_space_bucket) +
MAX_NUM_FREE_SPACES * sizeof (seg_free_space);
- free_space_buckets = (free_space_bucket*) new (nothrow) (BYTE[total_prealloc_size]);
+ free_space_buckets = (free_space_bucket*) new (nothrow) BYTE[total_prealloc_size];
return (!!free_space_buckets);
}
@@ -16810,7 +16810,7 @@ gc_heap::ha_mark_object_simple (BYTE** po THREAD_NUMBER_DCL)
{
if (!internal_root_array)
{
- internal_root_array = new (nothrow) (BYTE* [internal_root_array_length]);
+ internal_root_array = new (nothrow) BYTE* [internal_root_array_length];
if (!internal_root_array)
{
heap_analyze_success = FALSE;
@@ -16829,7 +16829,7 @@ gc_heap::ha_mark_object_simple (BYTE** po THREAD_NUMBER_DCL)
}
else
{
- BYTE** tmp = new (nothrow) (BYTE* [new_size]);
+ BYTE** tmp = new (nothrow) BYTE* [new_size];
if (tmp)
{
memcpy (tmp, internal_root_array,
@@ -17715,7 +17715,7 @@ recheck:
{
dprintf (2, ("h%d: ov grow to %Id", heap_number, new_size));
- BYTE** tmp = new (nothrow) (BYTE* [new_size]);
+ BYTE** tmp = new (nothrow) BYTE* [new_size];
if (tmp)
{
delete background_mark_stack_array;
@@ -17821,7 +17821,7 @@ recheck:
if ((mark_stack_array_length < new_size) &&
((new_size - mark_stack_array_length) > (mark_stack_array_length / 2)))
{
- mark* tmp = new (nothrow) (mark [new_size]);
+ mark* tmp = new (nothrow) mark [new_size];
if (tmp)
{
delete mark_stack_array;
@@ -25135,7 +25135,7 @@ void gc_heap::background_grow_c_mark_list()
}
else
{
- new_c_mark_list = new (nothrow) (BYTE*[c_mark_list_length*2]);
+ new_c_mark_list = new (nothrow) BYTE*[c_mark_list_length*2];
if (new_c_mark_list == 0)
{
should_drain_p = TRUE;
@@ -35084,7 +35084,7 @@ CFinalize::GrowArray()
size_t oldArraySize = (m_EndArray - m_Array);
size_t newArraySize = (size_t)(((float)oldArraySize / 10) * 12);
- Object** newArray = new (nothrow)(Object*[newArraySize]);
+ Object** newArray = new (nothrow) Object*[newArraySize];
if (!newArray)
{
// It's not safe to throw here, because of the FinalizeLock. Tell our caller
diff --git a/src/inc/arraylist.h b/src/inc/arraylist.h
index 907fc5f9e4..f6f4014c4e 100644
--- a/src/inc/arraylist.h
+++ b/src/inc/arraylist.h
@@ -496,7 +496,7 @@ public:
class ItemIterator
{
- typedef typename StructArrayList<ELEMENT_TYPE, INITIAL_CHUNK_LENGTH, CHUNK_LENGTH_GROWTH_FACTOR, ALLOCATOR>
+ typedef StructArrayList<ELEMENT_TYPE, INITIAL_CHUNK_LENGTH, CHUNK_LENGTH_GROWTH_FACTOR, ALLOCATOR>
SAList;
typedef typename StructArrayList<ELEMENT_TYPE, INITIAL_CHUNK_LENGTH, CHUNK_LENGTH_GROWTH_FACTOR, ALLOCATOR>::ArrayIterator
diff --git a/src/inc/complex.h b/src/inc/complex.h
index e2cbeb6ad4..82a39fea3a 100644
--- a/src/inc/complex.h
+++ b/src/inc/complex.h
@@ -32,7 +32,7 @@ public:
double r;
double i;
- Complex() : r(0), i(i) {}
+ Complex() : r(0), i(0) {}
Complex(double real) : r(real), i(0) {}
Complex(double real, double imag) : r(real), i(imag) {}
Complex(const Complex& other) : r(other.r), i(other.i) {}
diff --git a/src/md/enc/metamodelrw.cpp b/src/md/enc/metamodelrw.cpp
index 70b8e72a44..1575ebfaa1 100644
--- a/src/md/enc/metamodelrw.cpp
+++ b/src/md/enc/metamodelrw.cpp
@@ -3511,7 +3511,7 @@ CMiniMdRW::SaveFullTablesToStream(
// For each table...
for (ixTbl=0; ixTbl<m_TblCount; ++ixTbl)
{
- headerOffset[ixTbl] = ~0UL;
+ headerOffset[ixTbl] = ~0U;
ULONG itemCount = GetCountRecs(ixTbl);
if (itemCount)
diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h
index c05cd3950e..6eb2f91007 100644
--- a/src/pal/inc/pal.h
+++ b/src/pal/inc/pal.h
@@ -165,7 +165,7 @@ extern "C" {
#endif // !_MSC_VER
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__llvm__)
#define DECLSPEC_ALIGN(x) __declspec(align(x))
#else
#define DECLSPEC_ALIGN(x)
@@ -6169,7 +6169,6 @@ PAL_CppRethrow();
#define DBG_TERMINATE_THREAD ((DWORD )0x40010003L)
#define DBG_TERMINATE_PROCESS ((DWORD )0x40010004L)
#define DBG_CONTROL_C ((DWORD )0x40010005L)
-#define DBG_PRINTEXCEPTION_C ((DWORD )0x40010006L)
#define DBG_RIPEXCEPTION ((DWORD )0x40010007L)
#define DBG_CONTROL_BREAK ((DWORD )0x40010008L)
#define DBG_COMMAND_EXCEPTION ((DWORD )0x40010009L)
diff --git a/src/pal/inc/pal_char16.h b/src/pal/inc/pal_char16.h
index 1b82ff535c..1f475b32f9 100644
--- a/src/pal/inc/pal_char16.h
+++ b/src/pal/inc/pal_char16.h
@@ -44,6 +44,8 @@ typedef char16_t wchar_t;
typedef unsigned short wchar_t;
#endif // __cplusplus
#endif // PLATFORM_UNIX
+#ifndef _WCHAR_T_DEFINED
#define _WCHAR_T_DEFINED
+#endif // !_WCHAR_T_DEFINED
#endif // !_WCHAR_T_DEFINED || !_MSC_VER
diff --git a/src/vm/amd64/unixstubs.cpp b/src/vm/amd64/unixstubs.cpp
index 2615bdb715..d7a86bb826 100644
--- a/src/vm/amd64/unixstubs.cpp
+++ b/src/vm/amd64/unixstubs.cpp
@@ -100,7 +100,7 @@ extern "C"
" mov %%ebx, 4(%[result])\n" \
" mov %%ecx, 8(%[result])\n" \
" mov %%edx, 12(%[result])\n" \
- : "=a"(eax) /*output in eax*/\
+ : "=a"(eax) /*output in eax*/\
: "a"(arg), [result]"r"(result) /*inputs - arg in eax, result in any register*/\
: "eax", "rbx", "ecx", "edx" /* registers that are clobbered*/
);
@@ -115,7 +115,7 @@ extern "C"
" mov %%ebx, 4(%[result])\n" \
" mov %%ecx, 8(%[result])\n" \
" mov %%edx, 12(%[result])\n" \
- : "=a"(eax) /*output in eax*/\
+ : "=a"(eax) /*output in eax*/\
: "c"(arg1), "a"(arg2), [result]"r"(result) /*inputs - arg1 in ecx, arg2 in eax, result in any register*/\
: "eax", "rbx", "ecx", "edx" /* registers that are clobbered*/
);
diff --git a/src/vm/amd64/virtualcallstubcpu.hpp b/src/vm/amd64/virtualcallstubcpu.hpp
index 3841d6f45f..6633cdffa0 100644
--- a/src/vm/amd64/virtualcallstubcpu.hpp
+++ b/src/vm/amd64/virtualcallstubcpu.hpp
@@ -623,7 +623,7 @@ void ResolveHolder::InitializeStatic()
#pragma warning(disable:4305 4309)
#endif // defined(_MSC_VER)
- resolveInit._hashedToken = 0xcccccccccccccccc;
+ resolveInit._hashedToken = 0xcccccccc;
#if defined(_MSC_VER)
#pragma warning(pop)
diff --git a/src/vm/corhost.cpp b/src/vm/corhost.cpp
index 37488f09e7..9abbed4495 100644
--- a/src/vm/corhost.cpp
+++ b/src/vm/corhost.cpp
@@ -7830,7 +7830,7 @@ void CExecutionEngine::SetupTLSForThread(Thread *pThread)
pThread->AddFiberInfo(Thread::ThreadTrackInfo_Lifetime);
#endif
#ifdef STRESS_LOG
- if (StressLog::StressLogOn(~0ul, 0))
+ if (StressLog::StressLogOn(~0u, 0))
{
StressLog::CreateThreadStressLog();
}
diff --git a/src/vm/exceptionhandling.cpp b/src/vm/exceptionhandling.cpp
index f984f94379..36dca5ee12 100644
--- a/src/vm/exceptionhandling.cpp
+++ b/src/vm/exceptionhandling.cpp
@@ -106,7 +106,7 @@ static ExceptionTracker* GetTrackerMemory()
return g_theTrackerAllocator.GetTrackerMemory();
}
-static void FreeTrackerMemory(ExceptionTracker* pTracker, TrackerMemoryType mem)
+void FreeTrackerMemory(ExceptionTracker* pTracker, TrackerMemoryType mem)
{
CONTRACTL
{
@@ -380,8 +380,10 @@ void ExceptionTracker::UpdateNonvolatileRegisters(CONTEXT *pContextRecord, REGDI
UPDATEREG(Rbx);
UPDATEREG(Rbp);
+#ifndef UNIX_AMD64_ABI
UPDATEREG(Rsi);
UPDATEREG(Rdi);
+#endif
UPDATEREG(R12);
UPDATEREG(R13);
UPDATEREG(R14);
diff --git a/src/vm/gcstress.h b/src/vm/gcstress.h
index adc02d7470..cda7e13b50 100644
--- a/src/vm/gcstress.h
+++ b/src/vm/gcstress.h
@@ -188,10 +188,10 @@ namespace _GCStress
{
// no definition provided so that absence of concrete implementations cause compiler errors
template <enum gcs_trigger_points>
- static bool IsEnabled();
+ bool IsEnabled();
template<> FORCEINLINE
- static bool IsEnabled<cfg_any>()
+ bool IsEnabled<cfg_any>()
{
// Most correct would be to test for each specific bits, but we've
// always only tested against 0...
@@ -203,7 +203,7 @@ namespace _GCStress
#define DefineIsEnabled(cfg_enum, eeconfig_bits) \
template<> FORCEINLINE \
- static bool IsEnabled<cfg_enum>() \
+ bool IsEnabled<cfg_enum>() \
{ \
return (g_pConfig->GetGCStressLevel() & (eeconfig_bits)) != 0; \
}
diff --git a/src/vm/methodtable.cpp b/src/vm/methodtable.cpp
index 35db4ac651..781b946e6d 100644
--- a/src/vm/methodtable.cpp
+++ b/src/vm/methodtable.cpp
@@ -4451,9 +4451,6 @@ VOID DoAccessibilityCheckForConstraints(MethodTable *pAskingMT, TypeVarTypeDesc
// walked. Note that it would be just as correct to always defer to the pending list -
// however, that is a little less performant.
//
-// pInstContext - instantiation context created in code:SigPointer.GetTypeHandleThrowing and
-// ultimately passed down to code:TypeVarTypeDesc.SatisfiesConstraints.
-//
// Closure of locals necessary for implementing CheckForEquivalenceAndFullyLoadType.
@@ -4463,7 +4460,6 @@ struct DoFullyLoadLocals
DoFullyLoadLocals(DFLPendingList *pPendingParam, ClassLoadLevel levelParam, MethodTable *pMT, Generics::RecursionGraph *pVisited) :
newVisited(pVisited, TypeHandle(pMT)),
pPending(pPendingParam),
- pInstContext(pInstContext),
level(levelParam),
fBailed(FALSE)
#ifdef FEATURE_COMINTEROP
@@ -4477,7 +4473,6 @@ struct DoFullyLoadLocals
Generics::RecursionGraph newVisited;
DFLPendingList * const pPending;
- const InstantiationContext * const pInstContext;
const ClassLoadLevel level;
BOOL fBailed;
#ifdef FEATURE_COMINTEROP
@@ -4507,7 +4502,7 @@ static void CheckForEquivalenceAndFullyLoadType(Module *pModule, mdToken token,
TypeHandle th = sigPtr.GetTypeHandleThrowing(pModule, pTypeContext, ClassLoader::LoadTypes, (ClassLoadLevel)(pLocals->level - 1));
CONSISTENCY_CHECK(!th.IsNull());
- th.DoFullyLoad(&pLocals->newVisited, pLocals->level, pLocals->pPending, &pLocals->fBailed, pLocals->pInstContext);
+ th.DoFullyLoad(&pLocals->newVisited, pLocals->level, pLocals->pPending, &pLocals->fBailed, NULL);
pLocals->fDependsOnEquivalentOrForwardedStructs = TRUE;
pLocals->fHasEquivalentStructParameter = TRUE;
}
diff --git a/src/vm/multicorejit.cpp b/src/vm/multicorejit.cpp
index 8517f1d2d2..8ba943108c 100644
--- a/src/vm/multicorejit.cpp
+++ b/src/vm/multicorejit.cpp
@@ -78,13 +78,6 @@ bool MulticoreJitManager::IsLoadOkay(Module * pModule)
#endif
-// #define MCGEN_ENABLE_CHECK(Context, Descriptor) (Context.IsEnabled && McGenEventTracingEnabled(&Context, &Descriptor))
-
-// #define FireEtwMulticoreJit(ClrInstanceID, String1, String2, Int1, Int2, Int3)\
-// MCGEN_ENABLE_CHECK(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_Context, MulticoreJit) ?\
-// CoMofTemplate_hzzddd(Microsoft_Windows_DotNETRuntimePrivateHandle, &MulticoreJit, &CLRMulticoreJitId, ClrInstanceID, String1, String2, Int1, Int2, Int3)\
-// : ERROR_SUCCESS\
-
void MulticoreJitFireEtw(const wchar_t * pAction, const wchar_t * pTarget, int p1, int p2, int p3)
{
LIMITED_METHOD_CONTRACT
diff --git a/src/vm/syncblk.cpp b/src/vm/syncblk.cpp
index a0e7b0daa2..83e4f4eb27 100644
--- a/src/vm/syncblk.cpp
+++ b/src/vm/syncblk.cpp
@@ -1129,8 +1129,8 @@ void SyncBlockCache::Grow()
COMPlusThrowOM();
}
- newSyncTable = new(SyncTableEntry[newSyncTableSize]);
- newBitMap = new(DWORD[BitMapSize (newSyncTableSize)]);
+ newSyncTable = new SyncTableEntry[newSyncTableSize];
+ newBitMap = new DWORD[BitMapSize (newSyncTableSize)];
{
diff --git a/src/vm/threadsuspend.cpp b/src/vm/threadsuspend.cpp
index 46e9e65c5e..98800f6e85 100644
--- a/src/vm/threadsuspend.cpp
+++ b/src/vm/threadsuspend.cpp
@@ -1098,7 +1098,7 @@ BOOL Thread::IsExecutingWithinCer()
pThread->StackWalkFrames(TAStackCrawlCallBack, &sContext);
#ifdef STRESS_LOG
- if (sContext.fWithinCer && StressLog::StressLogOn(~0ul, 0))
+ if (sContext.fWithinCer && StressLog::StressLogOn(~0u, 0))
{
// If stress log is on, write info to stress log
StackCrawlContext sContext1 = { pThread,
@@ -1459,7 +1459,7 @@ BOOL Thread::ReadyForAsyncException(ThreadInterruptMode mode)
#ifdef STRESS_LOG
REGDISPLAY rd1;
- if (StressLog::StressLogOn(~0ul, 0))
+ if (StressLog::StressLogOn(~0u, 0))
{
CONTEXT ctx1;
CopyRegDisplay(&rd, &rd1, &ctx1);
@@ -1494,7 +1494,7 @@ BOOL Thread::ReadyForAsyncException(ThreadInterruptMode mode)
}
#ifdef STRESS_LOG
- if (StressLog::StressLogOn(~0ul, 0) &&
+ if (StressLog::StressLogOn(~0u, 0) &&
(IsRudeAbort() || !TAContext.fWithinEHClause))
{
//Save into stresslog.