I compiled mxml on CYGWIN and I got these messages on screen:
mxml-private.c:143:37: warning: initialization of ‘pthread_key_t’ {aka ‘struct __pthread_key_t *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
143 | static pthread_key_t _mxml_key = -1; /* Thread local storage key */
| ^
mxml-private.c: In function ‘_mxml_fini’:
mxml-private.c:171:17: warning: comparison between pointer and integer
171 | if (_mxml_key != -1)
| ^~
mxml-private.c:177:15: warning: assignment to ‘pthread_key_t’ {aka ‘struct __pthread_key_t *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
177 | _mxml_key = -1;
| ^
This happens because pthread_key_t is an opaque object and it should not be assumed to be an integer type.
In my opinion, this is not a good idea because, according to POSIX:
All of the types shall be defined as arithmetic types of an appropriate length, with the following exceptions:
....
pthread_key_t
....
It is true that, at least on CYGWIN, I can bypass the trouble by simply using the TLS APIs for Windows (just need to test __CYGWIN__ in addition to _WIN32 into mxml-private.c) but it would be worth to fix it since other platforms could have this trouble.
I compiled mxml on CYGWIN and I got these messages on screen:
This happens because
pthread_key_t
is an opaque object and it should not be assumed to be an integer type. In my opinion, this is not a good idea because, according to POSIX:https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html
It is true that, at least on CYGWIN, I can bypass the trouble by simply using the TLS APIs for Windows (just need to test
__CYGWIN__
in addition to_WIN32
into mxml-private.c) but it would be worth to fix it since other platforms could have this trouble.