Explorar o código

Fix pointer-to-int cast

Resolves "warning: performing pointer subtraction with a null pointer
has undefined behavior [-Wnull-pointer-subtraction]"
Saagar Jha %!s(int64=3) %!d(string=hai) anos
pai
achega
e25960c548
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      httpd.c

+ 1 - 1
httpd.c

@@ -366,7 +366,7 @@ void job_wait(xs_val **job)
 static void *job_thread(void *arg)
 static void *job_thread(void *arg)
 /* job thread */
 /* job thread */
 {
 {
-    int pid = (char *) arg - (char *) 0x0;
+    int pid = (int)(uintptr_t)arg;
 
 
     srv_debug(1, xs_fmt("job thread %d started", pid));
     srv_debug(1, xs_fmt("job thread %d started", pid));