diff options
author | David Mitchell <davem@iabyn.com> | 2013-11-24 19:44:41 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2013-11-24 20:24:25 +0000 |
commit | 04783dc7025287c5d75ab531602c7ec786a1e787 (patch) | |
tree | 049174f15e0cc2c532f5e4b5b072a8fa42350df6 /thread.h | |
parent | 7616a0c2898b38b86404e7b0afa635e0bf786677 (diff) | |
download | perl-04783dc7025287c5d75ab531602c7ec786a1e787.tar.gz |
fix 'ignoring return value' compiler warnings
Various system functions like write() are marked with the
__warn_unused_result__ attribute, which causes an 'ignoring return value'
warning to be emitted, even if the function call result is cast to (void).
The generic solution seems to be
int rc = write(...);
PERL_UNUSED_VAR(rc);
Diffstat (limited to 'thread.h')
-rw-r--r-- | thread.h | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -336,7 +336,9 @@ # define ALLOC_THREAD_KEY \ STMT_START { \ if (pthread_key_create(&PL_thr_key, 0)) { \ - (void)write(2, STR_WITH_LEN("panic: pthread_key_create failed\n")); \ + int rc; \ + rc = write(2, STR_WITH_LEN("panic: pthread_key_create failed\n")); \ + PERL_UNUSED_VAR(rc); \ exit(1); \ } \ } STMT_END |