diff options
author | Jan Kotas <jkotas@microsoft.com> | 2015-08-05 16:00:00 -0700 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2015-08-05 16:14:04 -0700 |
commit | e222536b41729093647689e7507e944fed490d08 (patch) | |
tree | 692391267ca6c3d2576fd3771ce7f78722238900 | |
parent | c32d22b11658f006b19b3094984edefeedf03215 (diff) | |
download | coreclr-e222536b41729093647689e7507e944fed490d08.tar.gz coreclr-e222536b41729093647689e7507e944fed490d08.tar.bz2 coreclr-e222536b41729093647689e7507e944fed490d08.zip |
Fix build breaks on VS2015 RTM
Most of the changes are about mismatches between printf formatting strings and argument types.
Fix #1294.
-rw-r--r-- | src/ToolBox/SOS/Strike/ExpressionNode.cpp | 2 | ||||
-rw-r--r-- | src/debug/daccess/nidump.cpp | 4 | ||||
-rw-r--r-- | src/gc/gc.cpp | 15 | ||||
-rw-r--r-- | src/gc/gcpriv.h | 5 | ||||
-rw-r--r-- | src/inc/warningcontrol.h | 1 | ||||
-rw-r--r-- | src/jit/compiler.cpp | 6 | ||||
-rw-r--r-- | src/jit/gentree.cpp | 6 | ||||
-rw-r--r-- | src/utilcode/bitvector.cpp | 2 | ||||
-rw-r--r-- | src/utilcode/util.cpp | 3 | ||||
-rw-r--r-- | src/vm/interoputil.cpp | 4 |
10 files changed, 25 insertions, 23 deletions
diff --git a/src/ToolBox/SOS/Strike/ExpressionNode.cpp b/src/ToolBox/SOS/Strike/ExpressionNode.cpp index 692c2b2c2a..ee69f51563 100644 --- a/src/ToolBox/SOS/Strike/ExpressionNode.cpp +++ b/src/ToolBox/SOS/Strike/ExpressionNode.cpp @@ -1044,7 +1044,7 @@ HRESULT ExpressionNode::PopulateTextValueHelper() case ELEMENT_TYPE_OBJECT: ULONG64 pointer; if(pInnerValue != NULL && SUCCEEDED(pInnerValue->GetAddress(&pointer))) - _snwprintf_s(pTextValue, MAX_EXPRESSION, _TRUNCATE, L"@ 0x%p", pointer); + _snwprintf_s(pTextValue, MAX_EXPRESSION, _TRUNCATE, L"@ 0x%p", (void *) pointer); break; case ELEMENT_TYPE_BOOLEAN: diff --git a/src/debug/daccess/nidump.cpp b/src/debug/daccess/nidump.cpp index 16f8bea1fe..c370bd5bdf 100644 --- a/src/debug/daccess/nidump.cpp +++ b/src/debug/daccess/nidump.cpp @@ -3385,7 +3385,7 @@ SIZE_T NativeImageDumper::TranslateAddressCallback(IXCLRDisassemblySupport *dis, if( ret == 0 ) { _snwprintf_s(name, nameSize, _TRUNCATE, W("@TRANSLATED ADDRESS@ %p"), - addr + (SIZE_T)pThis->m_currentAddress ); + (TADDR)(addr + (SIZE_T)pThis->m_currentAddress) ); ret = wcslen(name); *offset = -1; } @@ -3429,7 +3429,7 @@ SIZE_T NativeImageDumper::TranslateFixupCallback(IXCLRDisassemblySupport *dis, SIZE_T ret = pThis->TranslateSymbol(dis, address, name, nameSize, offset); if( ret == 0 ) { - _snwprintf_s(name, nameSize, _TRUNCATE, W("@TRANSLATED FIXUP@ %p"), address); + _snwprintf_s(name, nameSize, _TRUNCATE, W("@TRANSLATED FIXUP@ %p"), (TADDR)address); ret = wcslen(name); *offset = -1; } diff --git a/src/gc/gc.cpp b/src/gc/gc.cpp index 64585bcdde..b29afec3e8 100644 --- a/src/gc/gc.cpp +++ b/src/gc/gc.cpp @@ -1019,7 +1019,7 @@ retry: if (obj == alloc_objects[i]) { needs_checking = 0; - dprintf (3, ("cm: will spin", obj)); + dprintf (3, ("cm: will spin")); spin_and_switch (spin_count, (obj != alloc_objects[i])); goto retry; } @@ -1082,7 +1082,7 @@ retry: } else { - dprintf (3, ("loh alloc: will spin on checking", obj)); + dprintf (3, ("loh alloc: will spin on checking %Ix", obj)); spin_and_switch (spin_count, (needs_checking == 0)); goto retry; } @@ -1341,11 +1341,6 @@ BOOL recursive_gc_sync::allow_foreground() #endif //BACKGROUND_GC #endif //DACCESS_COMPILE -#ifdef _MSC_VER -// disable new LKG8 warning -#pragma warning(disable:4293) -#endif //_MSC_VER - #if defined(COUNT_CYCLES) || defined(JOIN_STATS) || defined(SYNCHRONIZATION_STATS) #ifdef _MSC_VER #pragma warning(disable:4035) @@ -22995,7 +22990,7 @@ void gc_heap::reloc_ref_in_shortened_obj (BYTE** address_to_set_card, BYTE** add if ((relocated_addr < hp->demotion_high) && (relocated_addr >= hp->demotion_low)) { - dprintf (3, ("%Ix on h#d, set card for location %Ix(%Ix)", + dprintf (3, ("%Ix on h%d, set card for location %Ix(%Ix)", relocated_addr, hp->heap_number, (size_t)address_to_set_card, card_of((BYTE*)address_to_set_card))); set_card (card_of ((BYTE*)address_to_set_card)); @@ -26766,7 +26761,7 @@ void gc_heap::fix_brick_to_highest (BYTE* o, BYTE* next_o) size_t limit = brick_of (next_o); //dprintf(3,(" fixing brick %Ix to point to object %Ix, till %Ix(%Ix)", dprintf(3,("b:%Ix->%Ix-%Ix", - new_current_brick, (size_t)o, (size_t)next_o, limit)); + new_current_brick, (size_t)o, (size_t)next_o)); while (b < limit) { set_brick (b,(new_current_brick - b)); @@ -29072,7 +29067,7 @@ static size_t linear_allocation_model (float allocation_fraction, size_t new_all { if ((allocation_fraction < 0.95) && (allocation_fraction > 0.0)) { - dprintf (2, ("allocation fraction: %d%", (int)(allocation_fraction/100.0))); + dprintf (2, ("allocation fraction: %d", (int)(allocation_fraction/100.0))); new_allocation = (size_t)(allocation_fraction*new_allocation + (1.0-allocation_fraction)*previous_desired_allocation); } #if 0 diff --git a/src/gc/gcpriv.h b/src/gc/gcpriv.h index 9736cecdab..ef0caef398 100644 --- a/src/gc/gcpriv.h +++ b/src/gc/gcpriv.h @@ -18,6 +18,11 @@ #include "gcrecord.h" +#ifdef _MSC_VER +#pragma warning(disable:4293) +#pragma warning(disable:4477) +#endif //_MSC_VER + inline void FATAL_GC_ERROR() { DebugBreak(); diff --git a/src/inc/warningcontrol.h b/src/inc/warningcontrol.h index 5fe33ade3a..bab0e429f7 100644 --- a/src/inc/warningcontrol.h +++ b/src/inc/warningcontrol.h @@ -48,6 +48,7 @@ #pragma warning(disable :4334) // result of 32-bit shift implicitly converted to 64 bits #pragma warning(disable :4345) // behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized #pragma warning(disable :4430) // missing type specifier: C++ doesn't support default-int +#pragma warning(disable :4477) // format string '%$S' requires an argument of type '%$S', but variadic argument %d has type '%$S' #pragma warning(3 :4509) // "nonstandard extension used: '%$S' uses SEH and '%$S' has destructor" // // But beware of doing a return from inside such a try block: diff --git a/src/jit/compiler.cpp b/src/jit/compiler.cpp index 5b5c16508e..427d778b90 100644 --- a/src/jit/compiler.cpp +++ b/src/jit/compiler.cpp @@ -5936,13 +5936,13 @@ void Compiler::AggregateMemStats::Print(FILE* f) fprintf(f, "For %9u methods:\n", nMethods); fprintf(f, " count: %12u (avg %7u per method)\n", allocCnt, allocCnt / nMethods); - fprintf(f, " alloc size : %12llu (avg %7u per method)\n", + fprintf(f, " alloc size : %12llu (avg %7llu per method)\n", allocSz, allocSz / nMethods); fprintf(f, " max alloc : %12llu\n", allocSzMax); fprintf(f, "\n"); - fprintf(f, " nraAlloc : %12llu (avg %7u per method)\n", + fprintf(f, " nraAlloc : %12llu (avg %7llu per method)\n", nraTotalSizeAlloc, nraTotalSizeAlloc / nMethods); - fprintf(f, " nraUsed : %12llu (avg %7u per method)\n", + fprintf(f, " nraUsed : %12llu (avg %7llu per method)\n", nraTotalSizeUsed, nraTotalSizeUsed / nMethods); PrintByKind(f); } diff --git a/src/jit/gentree.cpp b/src/jit/gentree.cpp index 680fb338a3..fafe416c43 100644 --- a/src/jit/gentree.cpp +++ b/src/jit/gentree.cpp @@ -8596,13 +8596,13 @@ GenTreePtr Compiler::gtDispLinearTree(GenTreeStmt* curStmt, // special case for child of initblk and cpblk // op1 is dst, op2 is src, and op2 must show up first assert(tree->OperIsBlkOp()); - sprintf_s(bufp, sizeof(buf), "Source", listElemNum, 0); + sprintf_s(bufp, sizeof(buf), "Source"); indentStack->Push(indentInfo); nextLinearNode = gtDispLinearTree(curStmt, nextLinearNode, child->gtOp.gtOp2, indentStack, bufp); indentStack->Pop(); indentInfo = IIArc; - sprintf_s(bufp, sizeof(buf), "Destination", listElemNum, 0); + sprintf_s(bufp, sizeof(buf), "Destination"); indentStack->Push(indentInfo); nextLinearNode = gtDispLinearTree(curStmt, nextLinearNode, child->gtOp.gtOp1, indentStack, bufp); indentStack->Pop(); @@ -8641,7 +8641,7 @@ GenTreePtr Compiler::gtDispLinearTree(GenTreeStmt* curStmt, } else { - sprintf_s(bufp, sizeof(buf), "List Item %d", listElemNum, 0); + sprintf_s(bufp, sizeof(buf), "List Item %d", listElemNum); } indentStack->Push(indentInfo); nextLinearNode = gtDispLinearTree(curStmt, nextLinearNode, listElem, indentStack, bufp); diff --git a/src/utilcode/bitvector.cpp b/src/utilcode/bitvector.cpp index 63af3acd93..719d2c8f8e 100644 --- a/src/utilcode/bitvector.cpp +++ b/src/utilcode/bitvector.cpp @@ -13,6 +13,8 @@ #include <memory.h> #include "contract.h" +#include "contract.inl" + #include "bitvector.h" #if USE_BITVECTOR diff --git a/src/utilcode/util.cpp b/src/utilcode/util.cpp index 8b1fa550dc..3bc6f73382 100644 --- a/src/utilcode/util.cpp +++ b/src/utilcode/util.cpp @@ -2930,8 +2930,7 @@ void SOViolation(const char *szFunction, const char *szFile, int lineNum, SOViol "\nPlease open a bug against the feature owner.\n" "\nNOTE: You can disable this ASSERT by setting COMPLUS_SOEnableBackoutStackValidation=0.\n" "\nFor details about this feature, see, in a CLR enlistment,\n" - "src\\ndp\\clr\\doc\\OtherDevDocs\\untriaged\\clrdev_web\\SO Guide for CLR Developers.doc\n", - szFunction, szFile, lineNum); + "src\\ndp\\clr\\doc\\OtherDevDocs\\untriaged\\clrdev_web\\SO Guide for CLR Developers.doc\n"); } else { diff --git a/src/vm/interoputil.cpp b/src/vm/interoputil.cpp index 2008938f6d..4d198a5c0f 100644 --- a/src/vm/interoputil.cpp +++ b/src/vm/interoputil.cpp @@ -2815,7 +2815,7 @@ void SafeReleaseStream(IStream *pStream) #ifdef _DEBUG wchar_t logStr[200]; - swprintf_s(logStr, NumItems(logStr), W("Object gone: CoReleaseMarshalData returned %x, file %s, line %d\n"), hr, __FILE__, __LINE__); + swprintf_s(logStr, NumItems(logStr), W("Object gone: CoReleaseMarshalData returned %x, file %S, line %d\n"), hr, __FILE__, __LINE__); LogInterop(logStr); if (hr != S_OK) { @@ -2825,7 +2825,7 @@ void SafeReleaseStream(IStream *pStream) ULARGE_INTEGER li2; pStream->Seek(li, STREAM_SEEK_SET, &li2); hr = CoReleaseMarshalData(pStream); - swprintf_s(logStr, NumItems(logStr), W("Object gone: CoReleaseMarshalData returned %x, file %s, line %d\n"), hr, __FILE__, __LINE__); + swprintf_s(logStr, NumItems(logStr), W("Object gone: CoReleaseMarshalData returned %x, file %S, line %d\n"), hr, __FILE__, __LINE__); LogInterop(logStr); } #endif |