[Gc] Re: [bdwgc] Extend thread-related debug messages. (00fb4f7)
ivmai at mail.ru
Thu Dec 29 22:43:13 PST 2011
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 <reply+c-827137-deeb69bc056f55bd94662b3152f640264284f0b5-460469 at reply.github.com>:
> 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:
More information about the Gc