From cbd672eb2735d583ee6fa46aaf599241fdf6face Mon Sep 17 00:00:00 2001 From: Sinan Kaya <41809318+franksinankaya@users.noreply.github.com> Date: Tue, 26 Feb 2019 05:55:05 -0500 Subject: GCC compatibility fixes #7 (#22810) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use thread_local for thread local storage on non MSVC targets * Use local copy of visitor rather than function parameter * Remove extra class qualifier * Replace hex number representation in ASM files * Reorder STDAPI and DLLEXPORT * Suppress conversion Suppress warning during hash add casting * Remove anonymous struct src/vm/codeversion.h:112:16: warning: ‘struct NativeCodeVersion::::SyntheticStorage’ invalid; an anonymous union can only have non-static data members [-fpermissive] struct SyntheticStorage * Remove class declaration Remove extra class declaration * Remove extern C * Add implicit paranthesis src/vm/amd64/virtualcallstubcpu.hpp:735:103: warning: suggest parentheses around ‘-’ in operand of ‘&’ [-Wparentheses] resolveInit.toMiss1 = offsetof(ResolveStub,miss)-(offsetof(ResolveStub,toMiss1)+1) & 0xFF; ^ src/vm/amd64/virtualcallstubcpu.hpp:741:103: warning: suggest parentheses around ‘-’ in operand of ‘&’ [-Wparentheses] resolveInit.toMiss2 = offsetof(ResolveStub,miss)-(offsetof(ResolveStub,toMiss2)+1) & 0xFF; Add parenthesis src/vm/dataimage.cpp:631:55: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] previousRvaInfo->rva == rvaInfo->rva && previousRvaInfo->size >= rvaInfo->size Add parenthesis src/debug/daccess/daccess.cpp:6871:29: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] _ASSERTE(peFile == NULL && reflectionModule != NULL || peFile != NULL && reflectionModule == NULL); Add parenthesis src/vm/dataimage.cpp:631:57: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] (previousRvaInfo->rva == rvaInfo->rva) && (previousRvaInfo->size >= rvaInfo->size) * Initialize member 1 src/ilasm/method.cpp:35:36: warning: operation on ‘((Method*)this)->Method::m_ulColumns[0]’ may be undefined [-Wsequence-point] m_ulColumns[0]=m_ulColumns[0]=0; * Remove unknown compiler option * Abstract DLLEXPORT --- src/ilasm/CMakeLists.txt | 2 +- src/ilasm/method.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ilasm') diff --git a/src/ilasm/CMakeLists.txt b/src/ilasm/CMakeLists.txt index f6852e63e8..3bb13ad6d1 100644 --- a/src/ilasm/CMakeLists.txt +++ b/src/ilasm/CMakeLists.txt @@ -52,7 +52,7 @@ if(CLR_CMAKE_PLATFORM_UNIX) # Clang also produces a bad-codegen on this prebuilt file with optimization. # https://github.com/dotnet/coreclr/issues/2305 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-delete-non-virtual-dtor") - add_compile_options(-Wno-deprecated-register) + add_compile_options(-Wno-register) add_compile_options(-Wno-array-bounds) add_compile_options(-Wno-unused-label) set_source_files_properties( prebuilt/asmparse.cpp PROPERTIES COMPILE_FLAGS "-O0" ) diff --git a/src/ilasm/method.cpp b/src/ilasm/method.cpp index 8fc300c23a..298fc15fa9 100644 --- a/src/ilasm/method.cpp +++ b/src/ilasm/method.cpp @@ -32,7 +32,7 @@ Method::Method(Assembler *pAssembler, Class *pClass, __in __nullterminated char m_szExportAlias = NULL; m_dwExportOrdinal = 0xFFFFFFFF; m_ulLines[0]=m_ulLines[1]=0; - m_ulColumns[0]=m_ulColumns[0]=0; + m_ulColumns[0]=m_ulColumns[1]=0; m_pbsBody = NULL; m_fNewBody = TRUE; m_fNew = TRUE; -- cgit v1.2.3