]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
hurd: More 64-bit integer casting fixes
authorSergey Bugaev <bugaevc@gmail.com>
Sun, 19 Mar 2023 15:09:55 +0000 (18:09 +0300)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 2 Apr 2023 23:03:06 +0000 (01:03 +0200)
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
Message-Id: <20230319151017.531737-13-bugaevc@gmail.com>

sysdeps/mach/hurd/ioctl.c
sysdeps/mach/hurd/x86/init-first.c

index 0f5de5d3fb4be323fd300d5bde864db302351de9..ab913a59439f23ac1399a64611051416a90f6587 100644 (file)
@@ -149,10 +149,10 @@ __ioctl (int fd, unsigned long int request, ...)
             Rather than pointing to the value, ARG is the value itself.  */
 #ifdef MACH_MSG_TYPE_BIT
          *t++ = io2mach_type (1, _IOTS (integer_t));
-         *(integer_t *) t = (integer_t) arg;
+         *(integer_t *) t = (integer_t) (intptr_t) arg;
          t = (void *) t + sizeof (integer_t);
 #else
-         *(integer_t *) p = (integer_t) arg;
+         *(integer_t *) p = (integer_t) (intptr_t) arg;
          p = (void *) p + sizeof (integer_t);
 #endif
        }
index 6ca27155a4f415a2dfb86bfb4a1ca372768e678d..48c330ec0674c356d84dcf3df91d798b85c83588 100644 (file)
@@ -1,4 +1,4 @@
-/* Initialization code run first thing by the ELF startup code.  For i386/Hurd.
+/* Initialization code run first thing by the ELF startup code.  For x86/Hurd.
    Copyright (C) 1995-2023 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -92,7 +92,7 @@ posixland_init (int argc, char **argv, char **envp)
 static void
 init (void **data)
 {
-  int argc = (int) *data;
+  int argc = (int) (uintptr_t) *data;
   char **argv = (void *) (data + 1);
   char **envp = &argv[argc + 1];
   struct hurd_startup_data *d;