Menu

#39 pthread_getspecific() of an uninitialized key may have undefined behavior

open
elva fu
Threads (18)
5
2006-09-19
2006-09-19
No

conformance/interface/pthread_key_create/2-1.c first checks whether giving to pthread_getspecific an "uninitialized" value of key returns NULL. But posix says: « The effect of calling pthread_getspecific() or pthread_setspecific() with a key value not obtained from pthread_key_create() or after key has been deleted with pthread_key_delete() is undefined. »
So 2-1.c shouldn't do this first check.

Discussion


Log in to post a comment.