From b469f1e0fc5f0ac882161e627a1255ee11e67c37 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Sat, 31 May 2014 16:56:00 -0400 Subject: Use PERL_UNUSED_RESULT. (1) Enhance its description. (2) Simplify it: define only if has warn_unused_result. (3) Make it use STMT_START { ... } STMT_END to be less GNU-extensiony. (4) Redo 04783dc7 ("fix 'ignoring return value' compiler warnings") with it. --- thread.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'thread.h') diff --git a/thread.h b/thread.h index cd5563511d..43932fbb3b 100644 --- a/thread.h +++ b/thread.h @@ -336,9 +336,7 @@ # define ALLOC_THREAD_KEY \ STMT_START { \ if (pthread_key_create(&PL_thr_key, 0)) { \ - int rc; \ - rc = write(2, STR_WITH_LEN("panic: pthread_key_create failed\n")); \ - PERL_UNUSED_VAR(rc); \ + PERL_UNUSED_RESULT(write(2, STR_WITH_LEN("panic: pthread_key_create failed\n"))); \ exit(1); \ } \ } STMT_END -- cgit v1.2.1