Bug 26037 - Warning: passing argument 1 of 'mono_thread_join' makes pointer from integer without a cast
Summary: Warning: passing argument 1 of 'mono_thread_join' makes pointer from integer ...
Alias: None
Product: Runtime
Classification: Mono
Component: GC ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-01-14 16:23 UTC by Timotheus Pokorra
Modified: 2015-01-15 14:42 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Timotheus Pokorra 2015-01-14 16:23:22 UTC
This is with Mono 3.12.0:

[  455s]   CC       libmonoruntime_static_la-gc.lo
[  456s] gc.c: In function 'mono_gc_cleanup':
[  456s] gc.c:1227:5: warning: passing argument 1 of 'mono_thread_join' makes pointer from integer without a cast [enabled by default]
[  456s]      mono_thread_join (MONO_UINT_TO_NATIVE_THREAD_ID (gc_thread->tid));
[  456s]      ^
[  456s] In file included from ../../mono/metadata/object-internals.h:9:0,
[  456s]                  from ../../mono/metadata/gc-internal.h:14,
[  456s]                  from gc.c:16:
[  456s] ../../mono/metadata/threads-types.h:247:6: note: expected 'gpointer' but argument is of type 'long unsigned int'
[  456s]  void mono_thread_join (gpointer tid) MONO_INTERNAL;
[  456s]       ^

When building for openSUSE on OBS, this warning is treated as an error:
[ 2549s] E: mono-opt 64bit-portability-issue gc.c:1227
Comment 1 Timotheus Pokorra 2015-01-14 16:31:27 UTC
this is where the code line in question is in context:

if (!timed_out) {
    int ret;

    /* Wait for the thread to actually exit */
    ret = WaitForSingleObjectEx (gc_thread->handle, INFINITE, TRUE);
    g_assert (ret == WAIT_OBJECT_0);

    mono_thread_join (MONO_UINT_TO_NATIVE_THREAD_ID (gc_thread->tid));


typedef pthread_t MonoNativeThreadId;

typedef void* mono_native_thread_return_t;

#define MONO_NATIVE_THREAD_ID_TO_UINT(tid) (gsize)(tid)
#define MONO_UINT_TO_NATIVE_THREAD_ID(tid) (MonoNativeThreadId)(gsize)(tid)
Comment 2 Timotheus Pokorra 2015-01-14 16:33:45 UTC
on CentOS, the same warning looks like this:

[  704s] gc.c: In function 'mono_gc_cleanup':
[  704s] gc.c:1227: warning: passing argument 1 of 'mono_thread_join' makes pointer from integer without a cast
[  704s] ../../mono/metadata/threads-types.h:247: note: expected 'gpointer' but argument is of type 'guint64'
Comment 3 Zoltan Varga 2015-01-15 14:42:50 UTC
Fixed in mono master b27d0248772e0b3288fba4f7328bfea1a6693689.