>From 62b59ea8b734e72398f388e23c35bd42e6cbc38a Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Wed, 6 Jan 2021 17:35:33 +0100 Subject: [PATCH 3/3] maint: avoid warning for printing pid_t on Solaris 11 The type pid_t is defined as long on Solaris 11. Therefore, GCC issued a -Wformat warning there when attempting to print as %d. * find/exec.c: (launch): When writing the debug message, treat child_pid as the wider long type. --- find/exec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/find/exec.c b/find/exec.c index 6ea9f3a1..ab63d60e 100644 --- a/find/exec.c +++ b/find/exec.c @@ -373,9 +373,11 @@ launch (struct buildcmd_control *ctl, void *usercontext, int argc, char **argv) int ex = WEXITSTATUS (execp->last_child_status); if (options.debug_options & DebugExec) { + /* pid_t is of type long on Solaris 11. Cast CHILD_PID for use with + * %ld as long as gnulib doesn't provide portable PRIdPID. */ fprintf (stderr, - "DebugExec: process (PID=%d) terminated with exit status: %d\n", - child_pid, ex); + "DebugExec: process (PID=%ld) terminated with exit status: %d\n", + (long) child_pid, ex); } if (0 == ex) -- 2.29.2