diff options
author | Sinan Kaya <41809318+franksinankaya@users.noreply.github.com> | 2019-02-22 14:11:19 -0500 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2019-02-22 20:11:19 +0100 |
commit | 0495f7377fca88999d335757e9680052cfedc51d (patch) | |
tree | 3dc0a76c3ece4783d1884fcdf9e087ff663a7535 /src/dlls | |
parent | 1376e5fc5fa4b01a175e26be467a416f1c8765fc (diff) | |
download | coreclr-0495f7377fca88999d335757e9680052cfedc51d.tar.gz coreclr-0495f7377fca88999d335757e9680052cfedc51d.tar.bz2 coreclr-0495f7377fca88999d335757e9680052cfedc51d.zip |
More GNUC Fixes (#22687)
* Replace __sync_swap with __atomic_exchange_n
__sync_swap() is a clang specific function.
* Remove multiline comment
* Add paranthesis around sum
src/md/hotdata/../inc/streamutil.h:73:34: warning: suggest parentheses around ‘+’ in operand of ‘&’ [-Wparentheses]
UINT32 aligned = *totalBytes + 3 & ~3;
* Define __int64
* Define windows types for tests
* Remove undefined has_builtin defines and define alloca and inline for GNUC
* Remove __clang__ where possible
* Add implicit casting to help compiler find WCHAR* variant
src/binder/assembly.cpp:294:73: error: no matching function for call to ‘SString::SString(SString)’
return (pAsmName == nullptr ? nullptr : pAsmName->GetSimpleName());
^
In file included from src/inc/sstring.h:1082:0,
from src/inc/ex.h:19,
from src/inc/stgpool.h:28,
from src/inc/../md/inc/metamodel.h:18,
from src/inc/../md/inc/metamodelro.h:19,
from src/inc/metadata.h:17,
from src/binder/../vm/util.hpp:19,
from src/binder/../vm/common.h:110,
from src/binder/assembly.cpp:14:
src/inc/sstring.inl:73:8: note: candidate: SString::SString(void*, COUNT_T)
inline SString::SString(void *buffer, COUNT_T size)
^
src/inc/sstring.inl:73:8: note: candidate expects 2 arguments, 1 provided
src/inc/sstring.inl:436:8: note: candidate: SString::SString(SString::tagLiteral, const WCHAR*, COUNT_T)
inline SString::SString(tagLiteral dummytag, const WCHAR *literal, COUNT_T count)
^
src/inc/sstring.inl:436:8: note: candidate expects 3 arguments, 1 provided
src/inc/sstring.inl:418:8: note: candidate: SString::SString(SString::tagLiteral, const WCHAR*)
inline SString::SString(tagLiteral dummytag, const WCHAR *literal)
^
src/inc/sstring.inl:418:8: note: candidate expects 2 arguments, 1 provided
src/inc/sstring.inl:401:8: note: candidate: SString::SString(SString::tagUTF8Literal, const UTF8*)
inline SString::SString(tagUTF8Literal dummytag, const UTF8 *literal)
^
src/inc/sstring.inl:401:8: note: candidate expects 2 arguments, 1 provided
src/inc/sstring.inl:382:8: note: candidate: SString::SString(SString::tagLiteral, const CHAR*)
inline SString::SString(tagLiteral dummytag, const ASCII *literal)
* Reorder DLLEXPORT and STDAPI
GNUC wants extern "C" <attribute> format.
* Abstract __FUNCSIG__
* Abstract __debugbreak()
* Move common compiler options out of clang and add Wno-unused-value
* Add paranthesis around || and &&
src/gc/gc.cpp:9084:38: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
(!chosen_power2) && (i < free_space_count));
* Set Wno-delete-non-virtual-dtor for CXX files only
* Don't warn on unterminated endif labels
* Suppress unused functions
* Use 0x syntax rather than h syntax on GNU asm files
* Correct constructor call directly
src/ToolBox/superpmi/superpmi-shared/logging.cpp:301:27: required from here
src/inc/clr_std/string:58:9: error: cannot call constructor ‘std::basic_string<char>::basic_string’ directly
this->basic_string::basic_string(_Ptr, c_len(_Ptr));
* Suppress NULL used in arithmetic warnings
Diffstat (limited to 'src/dlls')
-rw-r--r-- | src/dlls/mscordbi/mscordbi.cpp | 3 | ||||
-rw-r--r-- | src/dlls/mscoree/mscoree.cpp | 14 | ||||
-rw-r--r-- | src/dlls/mscorpe/CMakeLists.txt | 2 |
3 files changed, 11 insertions, 8 deletions
diff --git a/src/dlls/mscordbi/mscordbi.cpp b/src/dlls/mscordbi/mscordbi.cpp index 7173e7343f..a44679b47d 100644 --- a/src/dlls/mscordbi/mscordbi.cpp +++ b/src/dlls/mscordbi/mscordbi.cpp @@ -18,10 +18,11 @@ extern BOOL WINAPI DbgDllMain(HINSTANCE hInstance, DWORD dwReason, // The main dll entry point for this module. This routine is called by the // OS when the dll gets loaded. Control is simply deferred to the main code. //***************************************************************************** +extern "C" #ifdef FEATURE_PAL DLLEXPORT // For Win32 PAL LoadLibrary emulation #endif -extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) +BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) { // Defer to the main debugging code. return DbgDllMain(hInstance, dwReason, lpReserved); diff --git a/src/dlls/mscoree/mscoree.cpp b/src/dlls/mscoree/mscoree.cpp index 45298c5294..d1c8a7620e 100644 --- a/src/dlls/mscoree/mscoree.cpp +++ b/src/dlls/mscoree/mscoree.cpp @@ -62,10 +62,11 @@ extern "C" BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwReason, LPVOID lpReserv // we need to capture coreclr's hInstance before the C runtime initializes. This function // will capture hInstance, let the C runtime initialize and then invoke the "classic" // DllMain that initializes everything else. +extern "C" #ifdef FEATURE_PAL DLLEXPORT // For Win32 PAL LoadLibrary emulation #endif -extern "C" BOOL WINAPI CoreDllMain(HANDLE hInstance, DWORD dwReason, LPVOID lpReserved) +BOOL WINAPI CoreDllMain(HANDLE hInstance, DWORD dwReason, LPVOID lpReserved) { STATIC_CONTRACT_NOTHROW; @@ -118,10 +119,11 @@ extern "C" BOOL WINAPI CoreDllMain(HANDLE hInstance, DWORD dwReason, LPVOID lpRe return result; } +extern "C" #ifdef FEATURE_PAL DLLEXPORT // For Win32 PAL LoadLibrary emulation #endif -extern "C" BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwReason, LPVOID lpReserved) +BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwReason, LPVOID lpReserved) { STATIC_CONTRACT_NOTHROW; @@ -226,7 +228,7 @@ HINSTANCE GetModuleInst() // %%Function: MetaDataGetDispenser // This function gets the Dispenser interface given the CLSID and REFIID. // --------------------------------------------------------------------------- -DLLEXPORT STDAPI MetaDataGetDispenser( // Return HRESULT +STDAPI DLLEXPORT MetaDataGetDispenser( // Return HRESULT REFCLSID rclsid, // The class to desired. REFIID riid, // Interface wanted on class factory. LPVOID FAR *ppv) // Return interface pointer here. @@ -256,7 +258,7 @@ ErrExit: // %%Function: GetMetaDataInternalInterface // This function gets the IMDInternalImport given the metadata on memory. // --------------------------------------------------------------------------- -DLLEXPORT STDAPI GetMetaDataInternalInterface( +STDAPI DLLEXPORT GetMetaDataInternalInterface( LPVOID pData, // [IN] in memory metadata section ULONG cbData, // [IN] size of the metadata section DWORD flags, // [IN] MDInternal_OpenForRead or MDInternal_OpenForENC @@ -285,7 +287,7 @@ DLLEXPORT STDAPI GetMetaDataInternalInterface( // This function gets the internal scopeless interface given the public // scopeless interface. // --------------------------------------------------------------------------- -DLLEXPORT STDAPI GetMetaDataInternalInterfaceFromPublic( +STDAPI DLLEXPORT GetMetaDataInternalInterfaceFromPublic( IUnknown *pv, // [IN] Given interface. REFIID riid, // [IN] desired interface void **ppv) // [OUT] returned interface @@ -312,7 +314,7 @@ DLLEXPORT STDAPI GetMetaDataInternalInterfaceFromPublic( // This function gets the public scopeless interface given the internal // scopeless interface. // --------------------------------------------------------------------------- -DLLEXPORT STDAPI GetMetaDataPublicInterfaceFromInternal( +STDAPI DLLEXPORT GetMetaDataPublicInterfaceFromInternal( void *pv, // [IN] Given interface. REFIID riid, // [IN] desired interface. void **ppv) // [OUT] returned interface diff --git a/src/dlls/mscorpe/CMakeLists.txt b/src/dlls/mscorpe/CMakeLists.txt index fd884b1c46..2e91a02f51 100644 --- a/src/dlls/mscorpe/CMakeLists.txt +++ b/src/dlls/mscorpe/CMakeLists.txt @@ -11,7 +11,7 @@ set(MSCORPE_SOURCES if(WIN32) else() - add_compile_options(-Wno-delete-non-virtual-dtor) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-delete-non-virtual-dtor") endif(WIN32) add_library_clr(mscorpe STATIC |