diff options
author | Jan Vorlicek <janvorli@microsoft.com> | 2015-02-06 04:31:14 -0800 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2015-02-06 04:31:14 -0800 |
commit | 2646f6c12a46f859ba35fafa2a42576741443eb3 (patch) | |
tree | 5dadc2374fe0e0de9f70bd22828b270bcfc8248a | |
parent | 89d4ba21430c0be10b5fb8287d8fca6f8a941c5e (diff) | |
download | coreclr-2646f6c12a46f859ba35fafa2a42576741443eb3.tar.gz coreclr-2646f6c12a46f859ba35fafa2a42576741443eb3.tar.bz2 coreclr-2646f6c12a46f859ba35fafa2a42576741443eb3.zip |
Fix several warnings in Linux build
1) Usage of partially uninitialized variable when the compiler didn't know the condition is always true. This condition was calling a VolatileRead and only the VolatileRead actually matters so that right PDB annotation is generated and not optimized out in debug optimized builds. So I've removed the if.
2) Usage of nostdinc++ option as a general option - it complained when building C files
3) Usage of an unknown warning disabling compiler option with clang 3.5. The option was needed for clang 3.5.1 and later.
4) Usage of partially uninitialized variable in daccess.cpp - there is a code path that the compiler can see that doesn't initialize the status variable.
5) Empty body of a for loop warning in one or two PAL tests.
[tfs-changeset: 1411579]
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/debug/daccess/daccess.cpp | 2 | ||||
-rw-r--r-- | src/inc/ex.h | 2 | ||||
-rw-r--r-- | src/pal/tests/CMakeLists.txt | 2 |
5 files changed, 10 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a7302ed45d..aa0ad09ef8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -241,6 +241,8 @@ add_compile_options(-Wno-self-assign) add_compile_options(-Wno-bitfield-constant-conversion) add_compile_options(-Wno-unused-value) +add_compile_options(-Wno-unknown-warning-option) + #These seem to indicate real issues add_compile_options(-Wno-invalid-offsetof) add_compile_options(-Wno-return-type) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 35914f2f10..2822facb71 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,8 +14,10 @@ if(WIN32) enable_language(ASM_MASM) else(WIN32) enable_language(ASM) -# This prevents inclusion of standard compiler headers -add_compile_options(-nostdinc -nostdinc++) +# This prevents inclusion of standard C compiler headers +add_compile_options(-nostdinc) +# This prevents inclusion of standard C++ compiler headers +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdinc++") endif(WIN32) add_subdirectory(utilcode) diff --git a/src/debug/daccess/daccess.cpp b/src/debug/daccess/daccess.cpp index 9af15c6031..1e910d2506 100644 --- a/src/debug/daccess/daccess.cpp +++ b/src/debug/daccess/daccess.cpp @@ -4907,7 +4907,7 @@ ClrDataAccess::SetCodeNotifications( /* [in, size_is(numTokens)] */ ULONG32 flags[], /* [in] */ ULONG32 singleFlags) { - HRESULT status; + HRESULT status = E_UNEXPECTED; DAC_ENTER(); diff --git a/src/inc/ex.h b/src/inc/ex.h index e86cf402ca..8babb687b1 100644 --- a/src/inc/ex.h +++ b/src/inc/ex.h @@ -977,7 +977,7 @@ Exception *ExThrowWithInnerHelper(Exception *inner); CAutoTryCleanup<STATETYPE> __autoCleanupTry(__state); \ /* prevent annotations from being dropped by optimizations in debug */ \ INDEBUG(static bool __alwayszero;) \ - INDEBUG(if(!VolatileLoad(&__alwayszero))) \ + INDEBUG(VolatileLoad(&__alwayszero);) \ { \ /* this is necessary for Rotor exception handling to work */ \ DEBUG_ASSURE_NO_RETURN_BEGIN(EX_TRY) \ diff --git a/src/pal/tests/CMakeLists.txt b/src/pal/tests/CMakeLists.txt index a26ddb793b..b9ad7ed4f9 100644 --- a/src/pal/tests/CMakeLists.txt +++ b/src/pal/tests/CMakeLists.txt @@ -10,5 +10,7 @@ add_definitions(-DPIC=1) add_definitions(-DBIT64=1) add_definitions(-D_WIN64=1) +add_compile_options(-Wno-empty-body) + add_subdirectory(palsuite) |