Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Fwd: 5.8: LTO exposes some new issues



On Mon, Jul 27, 2020 at 2:47 PM Tomasz Kłoczko <kloczko.tomasz@xxxxxxxxx> wrote:
>
> Here is whole list of compile and linking warnings:
>
> exec.c: In function 'execcmd_fork':
> exec.c:2774:2: warning: ignoring return value of 'nice' declared with attribute 'warn_unused_result' [-Wunused-result]
>  2774 |  nice(5);
>       |  ^~~~~~~

This is a false positive. Patch to suppress the warning attached.

Roman.
diff --git a/Src/exec.c b/Src/exec.c
index 7120a2c34..ecad923de 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -2789,8 +2789,7 @@ execcmd_fork(Estate state, int how, int type, Wordcode varspc,
     /* Check if we should run background jobs at a lower priority. */
     if ((how & Z_ASYNC) && isset(BGNICE)) {
 	errno = 0;
-	nice(5);
-	if (errno)
+	if (nice(5) == -1 && errno)
 	    zwarn("nice(5) failed: %e", errno);
     }
 #endif /* HAVE_NICE */


Messages sorted by: Reverse Date, Date, Thread, Author