while (1) {
if (timeout != INFINITE) {
MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): waiting on semaphore for %li ms...",
- __func__, handle, timeout, (timeout - (now - start)));
+ __func__, handle, timeout, (long)(timeout - (now - start)));
ret = mono_os_sem_timedwait (&mp->exit_sem, (timeout - (now - start)), alerted ? MONO_SEM_FLAGS_ALERTABLE : MONO_SEM_FLAGS_NONE);
} else {
MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s (%p, %u): waiting on semaphore forever...",
return;
}
case MONO_EXCEPTION_INVALID_PROGRAM: {
- mono_error_set_invalid_program (oerror, (const char *)exception_data);
+ mono_error_set_invalid_program (oerror, "%s", (const char *)exception_data);
return;
}
case MONO_EXCEPTION_MISSING_METHOD:
mono_class_set_failure_and_error (MonoClass *klass, MonoError *error, const char *msg)
{
mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, mono_image_strdup (klass->image, msg));
- mono_error_set_type_load_class (error, klass, msg);
+ mono_error_set_type_load_class (error, klass, "%s", msg);
}
/**
fname = mono_metadata_string_heap (image, cols [MONO_MEMBERREF_NAME]);
if (!mono_verifier_verify_memberref_field_signature (image, cols [MONO_MEMBERREF_SIGNATURE], NULL)) {
- mono_error_set_bad_image (error, image, "Bad field '%s' signature 0x%08x", class_index, token);
+ mono_error_set_bad_image (error, image, "Bad field '%u' signature 0x%08x", class_index, token);
return NULL;
}
klass = mono_class_get_and_inflate_typespec_checked (image, MONO_TOKEN_TYPE_SPEC | nindex, context, error);
break;
default:
- mono_error_set_bad_image (error, image, "Bad field field '%s' signature 0x%08x", class_index, token);
+ mono_error_set_bad_image (error, image, "Bad field field '%u' signature 0x%08x", class_index, token);
}
if (!klass)
#else
res = g_try_malloc ((gulong)size);
if (!res)
- mono_error_set_out_of_memory (error, "Could not allocate %i bytes", size);
+ mono_error_set_out_of_memory (error, "Could not allocate %lu bytes", size);
#endif
return res;
}
o = (MonoObject *)mono_gc_alloc_vector (vtable, byte_len, len);
if (G_UNLIKELY (!o)) {
- mono_error_set_out_of_memory (error, "Could not allocate %i bytes", byte_len);
+ mono_error_set_out_of_memory (error, "Could not allocate %zd bytes", (gsize) byte_len);
return NULL;
}
o = (MonoObject *)mono_gc_alloc_vector (vtable, byte_len, n);
if (G_UNLIKELY (!o)) {
- mono_error_set_out_of_memory (error, "Could not allocate %i bytes", byte_len);
+ mono_error_set_out_of_memory (error, "Could not allocate %zd bytes", (gsize) byte_len);
return NULL;
}
s = (MonoString *)mono_gc_alloc_string (vtable, size, len);
if (G_UNLIKELY (!s)) {
- mono_error_set_out_of_memory (error, "Could not allocate %i bytes", size);
+ mono_error_set_out_of_memory (error, "Could not allocate %zd bytes", size);
return NULL;
}
g_free (parent_name);
g_free (type_name);
- mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_SECURITY, message);
+ mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_SECURITY, "%s", message);
mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, message);
// note: do not free string given to mono_class_set_failure
}
g_free (base_name);
g_free (method_name);
- mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_SECURITY, message);
+ mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_SECURITY, "%s", message);
mono_class_set_failure (override->klass, MONO_EXCEPTION_TYPE_LOAD, message);
// note: do not free string given to mono_class_set_failure
}
g_free (callee_name);
g_free (caller_name);
- mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_SECURITY, message);
+ mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_SECURITY, "%s", message);
ex = mono_get_exception_argument ("method", message);
g_free (message);
g_free (field_name);
g_free (caller_name);
- mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_SECURITY, message);
+ mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_SECURITY, "%s", message);
ex = mono_get_exception_field_access_msg (message);
g_free (message);
g_free (callee_name);
g_free (caller_name);
- mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_SECURITY, message);
+ mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_SECURITY, "%s", message);
ex = mono_get_exception_method_access_msg (message);
g_free (message);
tpdomain->outstanding_request --;
g_assert (tpdomain->outstanding_request >= 0);
- mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] worker running in domain %p",
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] worker running in domain %p (outstanding requests %d) ",
mono_native_thread_id_get (), tpdomain->domain, tpdomain->outstanding_request);
g_assert (tpdomain->domain);
if ((thread = mono_thread_create_internal (mono_get_root_domain (), worker_thread, NULL, TRUE, 0, &error)) != NULL) {
threadpool->worker_creation_current_count += 1;
- mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker, created %p, now = %d count = %d", mono_native_thread_id_get (), thread->tid, now, threadpool->worker_creation_current_count);
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_THREADPOOL, "[%p] try create worker, created %p, now = %d count = %d", mono_native_thread_id_get (), GUINT_TO_POINTER(thread->tid), now, threadpool->worker_creation_current_count);
mono_coop_mutex_unlock (&threadpool->worker_creation_lock);
return TRUE;
}
ret = FALSE;
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: we don't own %s handle %p (owned by %ld, me %ld)",
- __func__, mono_w32handle_ops_typename (type), handle, mutex_handle->tid, tid);
+ __func__, mono_w32handle_ops_typename (type), handle, (long)mutex_handle->tid, (long)tid);
} else {
ret = TRUE;
gchar *utf8_name;
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: creating %s handle, initial %d max %d name \"%s\"",
- __func__, mono_w32handle_ops_typename (MONO_W32HANDLE_NAMEDSEM), initial, max, name);
+ __func__, mono_w32handle_ops_typename (MONO_W32HANDLE_NAMEDSEM), initial, max, (const char*)name);
/* w32 seems to guarantee that opening named objects can't race each other */
mono_w32handle_namespace_lock ();
else if (info->exception_type == MONO_EXCEPTION_FIELD_ACCESS)
mono_error_set_generic_error (&cfg->error, "System", "FieldAccessException", "%s", msg);
else if (info->exception_type == MONO_EXCEPTION_UNVERIFIABLE_IL)
- mono_error_set_generic_error (&cfg->error, "System.Security", "VerificationException", msg);
+ mono_error_set_generic_error (&cfg->error, "System.Security", "VerificationException", "%s", msg);
if (!mono_error_ok (&cfg->error)) {
mono_cfg_set_exception (cfg, MONO_EXCEPTION_MONO_ERROR);
g_free (msg);
mono_cfg_set_exception_invalid_program (MonoCompile *cfg, char *msg)
{
mono_cfg_set_exception (cfg, MONO_EXCEPTION_MONO_ERROR);
- mono_error_set_generic_error (&cfg->error, "System", "InvalidProgramException", msg);
+ mono_error_set_generic_error (&cfg->error, "System", "InvalidProgramException", "%s", msg);
}
#endif /* DISABLE_JIT */
#include <config.h>
#include <mono/utils/atomic.h>
+#include <mono/utils/mono-compiler.h>
#include <mono/utils/mono-publib.h>
typedef enum {
void checked_build_thread_transition(const char *transition, void *info, int from_state, int suspend_count, int next_state, int suspend_count_delta);
-G_GNUC_NORETURN void mono_fatal_with_history(const char *msg, ...) MONO_ATTR_FORMAT_PRINTF(1,2);
+G_GNUC_NORETURN MONO_ATTR_FORMAT_PRINTF(1,2) void mono_fatal_with_history(const char *msg, ...);
#else
stack = mono_native_tls_get_value (coop_reset_count_stack_key);
if (!stack || 0 == stack->len)
- mono_fatal_with_history ("Received cookie %p but found no stack at all, %x\n", received_cookie);
+ mono_fatal_with_history ("Received cookie %p but found no stack at all\n", received_cookie);
expected_cookie = g_array_index (stack, gpointer, stack->len - 1);
stack->len --;
alerted = FALSE;
if (nhandles > MONO_W32HANDLE_MAXIMUM_WAIT_OBJECTS) {
- mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: too many handles: %d",
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: too many handles: %zd",
__func__, nhandles);
return MONO_W32HANDLE_WAIT_RET_FAILED;