From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 1E0343858D28 for ; Sat, 6 May 2023 19:47:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1E0343858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvNsL-0006Ph-Kp; Sat, 06 May 2023 15:47:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=In-Reply-To:MIME-Version:References:Subject:To:From: Date; bh=XXkOLgG03IR3usXzRMq5bqG8UojweooYhlvrQw36Ylg=; b=AUoGVu50O43iPYSI2FuT FezqPZ5hCuQ0i1EomjW40NNjyAySk8ied6OQK4vEeRbdhdL1FgykZlRCpZ4PoTGQyh/y2EGD0AP5n y4DgRKN1PZZDkg3oNQEbSCrkSQLiwC/rHwQUU00H3mMNK5flxwzpqEdSTqBVpMOX756OA4CAcUx4N 2cad++l0nmxFZcl/xFjbviPTs9TsdS9Y20ociDamAsYVYtAgtIDIv5x2DmMKryCVM35VNTxPzFgdU HbkWpSnnxBmklrhP8iSGKwkY+JJywV8n58iAhC2XmbsZ3em2Y99U5zcCMdf45mmG6sr80EsBQctew Aw/A9Hf9n+xpSQ==; Received: from lfbn-bor-1-1163-184.w92-158.abo.wanadoo.fr ([92.158.138.184] helo=begin) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvNsL-0005kG-EH; Sat, 06 May 2023 15:47:25 -0400 Received: from samy by begin with local (Exim 4.96) (envelope-from ) id 1pvNsK-00Aybl-15; Sat, 06 May 2023 21:47:24 +0200 Date: Sat, 6 May 2023 21:47:24 +0200 From: Samuel Thibault To: Flavio Cruz Cc: bug-hurd@gnu.org, libc-alpha@sourceware.org Subject: Re: [PATCH glibc] Update hurd/hurdselect.c to be more portable. Message-ID: <20230506194724.zlfumnpvhep6t2dy@begin> Mail-Followup-To: Flavio Cruz , bug-hurd@gnu.org, libc-alpha@sourceware.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Flavio Cruz, le ven. 05 mai 2023 00:20:39 -0400, a ecrit: > + /* 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 Now that it is static, rather move it to > +++ b/sysdeps/mach/mach_rpc.h > + > +/* 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; \ > + _t.t = *(type); _c.t = *(check);_t.w != _c.w; })) so it is tied to what it matters for?