From 44091705dbdb2e3751c03e4935b1e5a7cf169241 Mon Sep 17 00:00:00 2001 From: Explorer09 Date: Tue, 17 May 2022 19:15:37 +0800 Subject: Use of NULL in execlp() must have a pointer cast. Signed-off-by: Kang-Che Sung --- TraceScreen.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'TraceScreen.c') diff --git a/TraceScreen.c b/TraceScreen.c index c3a94492..90400b43 100644 --- a/TraceScreen.c +++ b/TraceScreen.c @@ -90,7 +90,9 @@ bool TraceScreen_forkTracer(TraceScreen* this) { char buffer[32] = {0}; xSnprintf(buffer, sizeof(buffer), "%d", this->super.process->pid); - execlp("strace", "strace", "-T", "-tt", "-s", "512", "-p", buffer, NULL); + // Use of NULL in variadic functions must have a pointer cast. + // The NULL constant is not required by standard to have a pointer type. + execlp("strace", "strace", "-T", "-tt", "-s", "512", "-p", buffer, (char *)NULL); // Should never reach here, unless execlp fails ... const char* message = "Could not execute 'strace'. Please make sure it is available in your $PATH."; -- cgit v1.2.3