{"action":"created","issue":{"url":"https://api.github.com/repos/xant/libhl/issues/9","labels_url":"https://api.github.com/repos/xant/libhl/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/xant/libhl/issues/9/comments","events_url":"https://api.github.com/repos/xant/libhl/issues/9/events","html_url":"https://github.com/xant/libhl/issues/9","id":103566620,"number":9,"title":"Completion of error handling","user":{"login":"elfring","id":660477,"avatar_url":"https://avatars.githubusercontent.com/u/660477?v=3","gravatar_id":"","url":"https://api.github.com/users/elfring","html_url":"https://github.com/elfring","followers_url":"https://api.github.com/users/elfring/followers","following_url":"https://api.github.com/users/elfring/following{/other_user}","gists_url":"https://api.github.com/users/elfring/gists{/gist_id}","starred_url":"https://api.github.com/users/elfring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elfring/subscriptions","organizations_url":"https://api.github.com/users/elfring/orgs","repos_url":"https://api.github.com/users/elfring/repos","events_url":"https://api.github.com/users/elfring/events{/privacy}","received_events_url":"https://api.github.com/users/elfring/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-27T18:23:23Z","updated_at":"2015-08-27T18:35:51Z","closed_at":null,"body":"1. Would you like to add more error handling for return values from functions like the following?\r\n  * [pthread_mutex_lock](http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_lock.html \"Lock a mutex.\") ⇒ [list_sort](https://github.com/xant/libhl/blob/4baaddba421461c4d02a9ffbf36d021938eac902/src/linklist.c#L1184)\r\n  * [pthread_spin_init](http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_spin_init.html \"Initialize a spin lock object.\") ⇒ [ht_set_list](https://github.com/xant/libhl/blob/4baaddba421461c4d02a9ffbf36d021938eac902/src/hashtable.c#L374)\r\n2. How do you think about to annotate any functions with \"[`__attribute__((warn_unused_result))`](https://gcc.gnu.org/onlinedocs/gcc-5.2.0/gcc/Function-Attributes.html#index-g_t_0040code_007bwarn_005funused_005fresult_007d-function-attribute-3299 \"Warn on unused results?\")\"?"},"comment":{"url":"https://api.github.com/repos/xant/libhl/issues/comments/135517232","html_url":"https://github.com/xant/libhl/issues/9#issuecomment-135517232","issue_url":"https://api.github.com/repos/xant/libhl/issues/9","id":135517232,"user":{"login":"jhi","id":223441,"avatar_url":"https://avatars.githubusercontent.com/u/223441?v=3","gravatar_id":"","url":"https://api.github.com/users/jhi","html_url":"https://github.com/jhi","followers_url":"https://api.github.com/users/jhi/followers","following_url":"https://api.github.com/users/jhi/following{/other_user}","gists_url":"https://api.github.com/users/jhi/gists{/gist_id}","starred_url":"https://api.github.com/users/jhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhi/subscriptions","organizations_url":"https://api.github.com/users/jhi/orgs","repos_url":"https://api.github.com/users/jhi/repos","events_url":"https://api.github.com/users/jhi/events{/privacy}","received_events_url":"https://api.github.com/users/jhi/received_events","type":"User","site_admin":false},"created_at":"2015-08-27T18:35:51Z","updated_at":"2015-08-27T18:35:51Z","body":"On Thursday-201508-27 14:30, Andrea Guzzo wrote:\n> |pthread_mutex_lock() will fail if: [EDEADLK] A deadlock would occur if\n> the thread blocked waiting for mutex. [EINVAL] The value specified by\n> mutex is invalid. |\n>\n> actually EDEADLK happens only if specific attributes are passed to\n> PTHREAD_MUTEX_INIT (not our case)\n> EINVAL only if the muxs is not valid which is not possible because\n> initialization is checked (and memory corruption is not an option).\n> So checking the return value of pthread_mutex_lock() is superfluous.\n\nYou are assuming here a 100% compliant (nothing missing, nothing added, \nand completely forever unchanging) implementation.  This is, usually, a \nfantasy. Just check the value.\n\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/xant/libhl/issues/9#issuecomment-135515406>.\n>\n\n"}}