Skip to content

Commit

Permalink
cgo/process_utils: fix 32bit builds
Browse files Browse the repository at this point in the history
New clang-14 reports errors for directly casting from an integer to a
pointer. Use uintptr_t to fix that problem and adhere to the casting
rules.

Fixes: #1395
Signed-off-by: Christian Brauner <[email protected]>
  • Loading branch information
brauner committed Nov 19, 2024
1 parent c7dd60d commit afa91aa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions shared/cgo/process_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,11 @@ static inline int setproctitle(char *title)
ret = prctl(PR_SET_MM, prctl_arg(PR_SET_MM_MAP), prctl_arg(&prctl_map),
prctl_arg(sizeof(prctl_map)), prctl_arg(0));
if (ret == 0) {
char *dest = (char *)arg_start;
char *dest;

dest = (char *)(uintptr_t)arg_start;
memcpy(dest, title, len - 1);
dest[len-1] = '\0';
dest[len - 1] = '\0';
}

return ret;
Expand Down

0 comments on commit afa91aa

Please sign in to comment.