summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSinan Kaya <41809318+franksinankaya@users.noreply.github.com>2019-03-04 01:55:22 -0500
committerJan Kotas <jkotas@microsoft.com>2019-03-03 22:55:22 -0800
commit9d3f264b9ef8b4715017ec615dcb6f9d57e607cc (patch)
tree44cdbdfc045ca93779e3d6faabe30ab2e4b56dd1
parent7da0883d9ceba31bccf36cc8cbbbf2fe77a4f3e0 (diff)
downloadcoreclr-9d3f264b9ef8b4715017ec615dcb6f9d57e607cc.tar.gz
coreclr-9d3f264b9ef8b4715017ec615dcb6f9d57e607cc.tar.bz2
coreclr-9d3f264b9ef8b4715017ec615dcb6f9d57e607cc.zip
Cleanup more GCC warnings (#22872)
* Add parenthesis src/vm/sha1.cpp: In function ‘void SHA1_block(SHA1_CTX*)’: src/vm/sha1.cpp:93:29: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses] #define ROUND3(B, C, D) ((C & (B | D) | (B & D)) + sha1_round3) ^ src/vm/sha1.cpp:139:32: note: in expansion of macro ‘ROUND3’ e += ROTATE32L(a, 5) + ROUND3(b, c, d) + msg80[i]; * Move declaration into same file as one was defined Extern the other one was static * Remove hr=hr undefined assignment * Fix mutli-line comment warning * Convert multi-character literal * Remove null check for stack local variables rc/vm/invokeutil.cpp: In static member function ‘static void InvokeUtil::SetValidField(CorElementType, TypeHandle, FieldDesc*, OBJECTREF*, OBJECTREF*, TypeHandle, CLR_BOOL*)’: src/vm/invokeutil.cpp:978:29: warning: the address of ‘Throwable’ will never be NULL [-Waddress] EX_CATCH_THROWABLE(&Throwable); ^ src/inc/ex.h:1087:21: note: in definition of macro ‘EX_CATCH_THROWABLE’ if (NULL != ppThrowable) ^
-rw-r--r--src/ToolBox/SOS/Strike/sildasm.cpp1
-rw-r--r--src/ToolBox/SOS/Strike/sos_md.h2
-rw-r--r--src/classlibnative/bcltype/varargsnative.cpp4
-rw-r--r--src/debug/di/module.cpp4
-rw-r--r--src/inc/ex.h5
-rw-r--r--src/vm/sha1.cpp2
-rw-r--r--src/zap/zapimage.cpp4
7 files changed, 9 insertions, 13 deletions
diff --git a/src/ToolBox/SOS/Strike/sildasm.cpp b/src/ToolBox/SOS/Strike/sildasm.cpp
index 911ff091e5..097376d553 100644
--- a/src/ToolBox/SOS/Strike/sildasm.cpp
+++ b/src/ToolBox/SOS/Strike/sildasm.cpp
@@ -65,6 +65,7 @@ static OpCode opcodes[] =
static ULONG position = 0;
static BYTE *pBuffer = NULL;
+static char* asString(CQuickBytes *out);
// The UNALIGNED is because on IA64 alignment rules would prevent
// us from reading a pointer from an unaligned source.
diff --git a/src/ToolBox/SOS/Strike/sos_md.h b/src/ToolBox/SOS/Strike/sos_md.h
index b589109986..a7cd30c3bc 100644
--- a/src/ToolBox/SOS/Strike/sos_md.h
+++ b/src/ToolBox/SOS/Strike/sos_md.h
@@ -872,8 +872,6 @@ typedef enum
}
PPFormatFlags;
-char* asString(CQuickBytes *out);
-
PCCOR_SIGNATURE PrettyPrintType(
PCCOR_SIGNATURE typePtr, // type to convert,
CQuickBytes *out, // where to put the pretty printed string
diff --git a/src/classlibnative/bcltype/varargsnative.cpp b/src/classlibnative/bcltype/varargsnative.cpp
index 33dd816477..10354c6897 100644
--- a/src/classlibnative/bcltype/varargsnative.cpp
+++ b/src/classlibnative/bcltype/varargsnative.cpp
@@ -87,8 +87,8 @@ static void InitCommon(VARARGS *data, VASigCookie** cookie)
// STACK_GROWS_DOWN_ON_ARGS_WALK
// <return address> ;; lower memory
- // <varargs_cookie> \
- // <argN> \
+ // <varargs_cookie> '\'
+ // <argN> '\'
// += sizeOfArgs
// /
// <arg1> /
diff --git a/src/debug/di/module.cpp b/src/debug/di/module.cpp
index 5097008be0..1263e710e4 100644
--- a/src/debug/di/module.cpp
+++ b/src/debug/di/module.cpp
@@ -4988,7 +4988,7 @@ HRESULT CordbNativeCode::EnsureReturnValueAllowedWorker(Instantiation *currentIn
IfFailRet(CordbType::SigToType(GetModule(), &original, &inst, &pType));
- IfFailRet(hr = pType->ReturnedByValue());
+ IfFailRet(pType->ReturnedByValue());
if (hr == S_OK) // not S_FALSE
return S_OK;
@@ -5001,7 +5001,7 @@ HRESULT CordbNativeCode::EnsureReturnValueAllowedWorker(Instantiation *currentIn
CordbType *pType = 0;
IfFailRet(CordbType::SigToType(GetModule(), &original, &inst, &pType));
- IfFailRet(hr = pType->ReturnedByValue());
+ IfFailRet(pType->ReturnedByValue());
if (hr == S_OK) // not S_FALSE
return S_OK;
diff --git a/src/inc/ex.h b/src/inc/ex.h
index 9cd2adbeaa..87d47c313d 100644
--- a/src/inc/ex.h
+++ b/src/inc/ex.h
@@ -1084,10 +1084,7 @@ Exception *ExThrowWithInnerHelper(Exception *inner);
#define EX_CATCH_THROWABLE(ppThrowable) \
EX_CATCH \
{ \
- if (NULL != ppThrowable) \
- { \
- *ppThrowable = GET_THROWABLE(); \
- } \
+ *ppThrowable = GET_THROWABLE(); \
} \
EX_END_CATCH(SwallowAllExceptions)
diff --git a/src/vm/sha1.cpp b/src/vm/sha1.cpp
index 6d0784e89a..6ac8d46bd2 100644
--- a/src/vm/sha1.cpp
+++ b/src/vm/sha1.cpp
@@ -90,7 +90,7 @@ static void SHA1_block(SHA1_CTX *ctx)
// (check cases B = 0 and B = 1)
#define ROUND2(B, C, D) ((B ^ C ^ D) + sha1_round2)
-#define ROUND3(B, C, D) ((C & (B | D) | (B & D)) + sha1_round3)
+#define ROUND3(B, C, D) (((C & (B | D)) | (B & D)) + sha1_round3)
#define ROUND4(B, C, D) ((B ^ C ^ D) + sha1_round4)
diff --git a/src/zap/zapimage.cpp b/src/zap/zapimage.cpp
index d5d48ae2d6..7a849fbfcc 100644
--- a/src/zap/zapimage.cpp
+++ b/src/zap/zapimage.cpp
@@ -1025,8 +1025,8 @@ HANDLE ZapImage::GenerateFile(LPCWSTR wszOutputFileName, CORCOMPILE_NGEN_SIGNATU
{
// Write the debug directory entry for the NGEN PDB
RSDS rsds = {0};
-
- rsds.magic = 'SDSR';
+
+ rsds.magic = VAL32(0x53445352); // "SDSR";
rsds.age = 1;
// our PDB signature will be the same as our NGEN signature.
// However we want the printed version of the GUID to be be the same as the