paurkedal/bdwgc — comment on commit 00fb4f757a8fb395ca43f13ea0927e3bb58c0bef
File:  line 0
By ivmai:

Hi Petter,

At first, I though about using WARN_PRIdPTR (used to print WARN argument), but since pthread_t is most likely a pointer or a some opaque integer, printing it as hex would be more readable, and %p had been used for pointers for quite long time, so I chose the latter.

The disadvantage is that %p is printed in platform-dependent way (e.g., some runtimes adds 0x prefix others not) but for debugging and logging purposes it's ok.

30 12 2011, 02:50 Petter Urkedal :
> Thanks for the note, it's good you found it useful. Minor comment: I see you don't want to rely on the C99 header, but I don't think casting to (void *) is quite portable either, since in principle the thread ID may be an integer wider than a pointer, though I practice it is unlikely.
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/paurkedal/bdwgc/commit/00fb4f757a8fb395ca43f13ea0927e3bb58c0bef#commitcomment-827137
>