Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions eng/native/configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@ if (CLR_CMAKE_HOST_UNIX)
# 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-uninitialized)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,7 @@ static int32_t GetSearchIteratorUsingCollator(
if (!U_SUCCESS(err))
{
int32_t r;
(void)r; // used only in assert
r = RestoreSearchHandle(pSortHandle, *pSearchIterator, options);
assert(r && "restoring search handle shouldn't fail.");
return -1;
Expand All @@ -824,6 +825,7 @@ static int32_t GetSearchIteratorUsingCollator(
if (!U_SUCCESS(err))
{
int32_t r;
(void)r; // used only in assert
r = RestoreSearchHandle(pSortHandle, *pSearchIterator, options);
assert(r && "restoring search handle shouldn't fail.");
return -1;
Expand Down
20 changes: 19 additions & 1 deletion src/libraries/Native/Unix/System.Native/pal_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,24 @@ static int SetGroups(uint32_t* userGroups, int32_t userGroupsLength, uint32_t* p
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[],
Expand Down Expand Up @@ -371,7 +389,7 @@ int32_t SystemNative_ForkAndExecProcess(const char* filename,
}
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.
Expand Down
1 change: 1 addition & 0 deletions src/libraries/Native/Unix/System.Native/pal_signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ void SystemNative_DisablePosixSignalHandling(int signalCode)
void InstallTTOUHandlerForConsole(ConsoleSigTtouHandler handler)
{
bool installed;
(void)installed; // used only for assert

pthread_mutex_lock(&lock);
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,7 @@ static void HandleShutdown()
// ensures that there are no callers already inside the string table
// when the unload (possibly) executes.
int result = pthread_mutex_lock(&g_err_mutex);
(void)result; // used only in assert
assert(!result && "Acquiring the error string table mutex failed.");

g_err_unloaded = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const char* CryptoNative_ErrReasonErrorString(uint64_t error)

#if defined NEED_OPENSSL_1_1 || defined NEED_OPENSSL_3_0
int result = pthread_mutex_lock(&g_err_mutex);
(void)result; // used only in assert
assert(!result && "Acquiring the error string table mutex failed.");

if (!g_err_unloaded)
Expand All @@ -57,6 +58,7 @@ void CryptoNative_ErrErrorStringN(uint64_t e, char* buf, int32_t len)
{
#if defined NEED_OPENSSL_1_1 || defined NEED_OPENSSL_3_0
int result = pthread_mutex_lock(&g_err_mutex);
(void)result; // used only in assert
assert(!result && "Acquiring the error string table mutex failed.");

if (!g_err_unloaded)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ static void DetectCiphersuiteConfiguration()
SSL_free(ssl);

int rv = SSL_CTX_set_cipher_list(ctx, "ALL");
(void)rv; // used only in assert
assert(rv);

ssl = SSL_new(ctx);
Expand Down