public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Samuel Thibault <sthibaul@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] Update BAD_TYPECHECK to work on x86_64
Date: Mon,  6 Nov 2023 22:29:53 +0000 (GMT)	[thread overview]
Message-ID: <20231106222953.D81C1385841B@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5dd3bda59c2d9da138f0d98808d087cdb95cdc17

commit 5dd3bda59c2d9da138f0d98808d087cdb95cdc17
Author: Flavio Cruz <flaviocruz@gmail.com>
Date:   Sun Nov 5 23:13:32 2023 -0500

    Update BAD_TYPECHECK to work on x86_64
    
    Message-ID: <ZUhn7LOcgLOJjKZr@jupiter.tail36e24.ts.net>

Diff:
---
 sysdeps/mach/mach_rpc.h | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/sysdeps/mach/mach_rpc.h b/sysdeps/mach/mach_rpc.h
index 152f057ca7..ed81403be6 100644
--- a/sysdeps/mach/mach_rpc.h
+++ b/sysdeps/mach/mach_rpc.h
@@ -20,11 +20,8 @@
 
 /* Macro used by MIG to cleanly check the type.  */
 #define BAD_TYPECHECK(type, check) __glibc_unlikely (({	\
-  union { mach_msg_type_t t; uint32_t w; } _t, _c;	\
+  union { mach_msg_type_t t; uintptr_t w; } _t, _c;	\
   _t.t = *(type); _c.t = *(check);_t.w != _c.w; }))
 
-/* TODO: add this assertion for x86_64.  */
-#ifndef __x86_64__
-_Static_assert (sizeof (uint32_t) == sizeof (mach_msg_type_t),
-                "mach_msg_type_t needs to be the same size as uint32_t");
-#endif
+_Static_assert (sizeof (uintptr_t) == sizeof (mach_msg_type_t),
+                "mach_msg_type_t needs to be the same size as uintptr_t");

                 reply	other threads:[~2023-11-06 22:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231106222953.D81C1385841B@sourceware.org \
    --to=sthibaul@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).