From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1792) id D81C1385841B; Mon, 6 Nov 2023 22:29:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D81C1385841B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1699309793; bh=w2dJBgB70kvZhYOfX8mOnvRFBhycSjLsCo9utI9m6a4=; h=From:To:Subject:Date:From; b=Dqyiln3z6vkk1LH1Oz26WDf+8dKvm59+zNPyjPAZ462vzOuArNIKSaJbTzyS7XrJe uLvVJcQs6WcVMZW92Xad5KNWpKFfLITwiLbFhmJCLVz14e8ienX/0WzP9D4wcAEluK KCH7McCUQJX2NBAelo++kHjLcsVcYG5Z6meltREY= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Samuel Thibault To: glibc-cvs@sourceware.org Subject: [glibc] Update BAD_TYPECHECK to work on x86_64 X-Act-Checkin: glibc X-Git-Author: Flavio Cruz X-Git-Refname: refs/heads/master X-Git-Oldrev: f957f47df75b9fab995754011491edebc6feb147 X-Git-Newrev: 5dd3bda59c2d9da138f0d98808d087cdb95cdc17 Message-Id: <20231106222953.D81C1385841B@sourceware.org> Date: Mon, 6 Nov 2023 22:29:53 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5dd3bda59c2d9da138f0d98808d087cdb95cdc17 commit 5dd3bda59c2d9da138f0d98808d087cdb95cdc17 Author: Flavio Cruz Date: Sun Nov 5 23:13:32 2023 -0500 Update BAD_TYPECHECK to work on x86_64 Message-ID: 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");