#These seem to indicate real issues
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-invalid-offsetof>)
- if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ add_compile_options(-Wno-unused-but-set-variable)
+
+ if (CMAKE_C_COMPILER_ID MATCHES "Clang")
+ add_compile_options(-Wno-unknown-warning-option)
+
# The -ferror-limit is helpful during the porting, it makes sure the compiler doesn't stop
# after hitting just about 20 errors.
add_compile_options(-ferror-limit=4096)
# Disabled warnings
add_compile_options(-Wno-unused-private-field)
- # Explicit constructor calls are not supported by clang (this->ClassName::ClassName())
- add_compile_options(-Wno-microsoft)
# There are constants of type BOOL used in a condition. But BOOL is defined as int
# and so the compiler thinks that there is a mistake.
add_compile_options(-Wno-constant-logical-operand)
# to a struct or a class that has virtual members or a base class. In that case, clang
# may not generate the same object layout as MSVC.
add_compile_options(-Wno-incompatible-ms-struct)
+
+ add_compile_options(-Wno-reserved-identifier)
else()
- add_compile_options(-Wno-unused-but-set-variable)
add_compile_options(-Wno-unknown-pragmas)
add_compile_options(-Wno-uninitialized)
add_compile_options(-Wno-strict-aliasing)
const COR_ILMETHOD_SECT* Next() const
{
if (!More()) return(0);
- return ((COR_ILMETHOD_SECT*)(((BYTE *)this) + DataSize()))->Align();
+ return ((COR_ILMETHOD_SECT*)Align(((BYTE *)this) + DataSize()));
}
const BYTE* Data() const
return((AsSmall()->Kind & CorILMethod_Sect_FatFormat) != 0);
}
- const COR_ILMETHOD_SECT* Align() const
+ static const void* Align(const void* p)
{
- return((COR_ILMETHOD_SECT*) ((((UINT_PTR) this) + 3) & ~3));
+ return((void*) ((((UINT_PTR) p) + 3) & ~3));
}
protected:
const COR_ILMETHOD_SECT* GetSect() const {
if (!More()) return (0);
- return(((COR_ILMETHOD_SECT*) (GetCode() + GetCodeSize()))->Align());
+ return(((COR_ILMETHOD_SECT*) COR_ILMETHOD_SECT::Align(GetCode() + GetCodeSize())));
}
} COR_ILMETHOD_FAT;
{
if (IsShort(env))
{
- (size_t&)out = (size_t)out & ((size_t)gen | (size_t)in);
+ out = (BitSetShortLongRep)((size_t)out & ((size_t)gen | (size_t)in));
}
else
{
{
if (IsShort(env))
{
- (size_t&)in = (size_t)use | ((size_t)out & ~(size_t)def);
+ in = (BitSetShortLongRep)((size_t)use | ((size_t)out & ~(size_t)def));
}
else
{
class ExtendedDefaultPolicy : public DefaultPolicy
{
public:
- ExtendedDefaultPolicy::ExtendedDefaultPolicy(Compiler* compiler, bool isPrejitRoot)
+ ExtendedDefaultPolicy(Compiler* compiler, bool isPrejitRoot)
: DefaultPolicy(compiler, isPrejitRoot)
, m_ProfileFrequency(0.0)
, m_BinaryExprWithCns(0)
add_compile_options(-Wno-typedef-redefinition)
add_compile_options(-Wno-c11-extensions)
add_compile_options(-Wno-unknown-pragmas)
+add_compile_options(-Wno-unknown-warning-option)
+add_compile_options(-Wno-unused-but-set-variable)
check_c_compiler_flag(-Wimplicit-fallthrough COMPILER_SUPPORTS_W_IMPLICIT_FALLTHROUGH)
if (COMPILER_SUPPORTS_W_IMPLICIT_FALLTHROUGH)
if(CMAKE_C_COMPILER_ID STREQUAL Clang)
add_compile_options(-Wthread-safety)
add_compile_options(-Wno-thread-safety-analysis)
+ add_compile_options(-Wno-reserved-identifier)
elseif(CMAKE_C_COMPILER_ID STREQUAL GNU)
add_compile_options(-Wno-stringop-truncation)
endif()
return rv;
}
+typedef void (*VoidIntFn)(int);
+
+static
+VoidIntFn
+handler_from_sigaction (struct sigaction *sa)
+{
+ if (((unsigned int)sa->sa_flags) & SA_SIGINFO)
+ {
+ // work around -Wcast-function-type
+ void (*tmp)(void) = (void (*)(void))sa->sa_sigaction;
+ return (void (*)(int))tmp;
+ }
+ else
+ {
+ return sa->sa_handler;
+ }
+}
+
int32_t SystemNative_ForkAndExecProcess(const char* filename,
char* const argv[],
char* const envp[],
}
if (!sigaction(sig, NULL, &sa_old))
{
- void (*oldhandler)(int) = (((unsigned int)sa_old.sa_flags) & SA_SIGINFO) ? (void (*)(int))sa_old.sa_sigaction : sa_old.sa_handler;
+ void (*oldhandler)(int) = handler_from_sigaction (&sa_old);
if (oldhandler != SIG_IGN && oldhandler != SIG_DFL)
{
// It has a custom handler, put the default handler back.