From b635863509d86bd85384da04dc5f4a6f03a764ba Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Fri, 11 May 2018 11:11:53 -0500 Subject: [PATCH] Fix warnings when compiling under clang Introduced by #4849 (add wait for processes by name) ../src/builtin_wait.cpp:23:14: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] while (j = jobs.next()) { ~~^~~~~~~~~~~~~ ../src/builtin_wait.cpp:23:14: note: place parentheses around the assignment to silence this warning while (j = jobs.next()) { ^ ( ) ../src/builtin_wait.cpp:23:14: note: use '==' to turn this assignment into an equality comparison while (j = jobs.next()) { ^ == 1 warning generated. --- src/builtin_wait.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/builtin_wait.cpp b/src/builtin_wait.cpp index 17ae9597a..215fba777 100644 --- a/src/builtin_wait.cpp +++ b/src/builtin_wait.cpp @@ -20,7 +20,7 @@ static job_id_t get_job_id_from_pid(pid_t pid) { job_t *j; job_iterator_t jobs; - while (j = jobs.next()) { + while ((j = jobs.next()) != nullptr) { if (j->pgid == pid) { return j->job_id; }