From nobody Wed Jun 11 17:54:39 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHYFr33Slz5yDtF; Wed, 11 Jun 2025 17:54:40 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHYFr2ChXz3khG; Wed, 11 Jun 2025 17:54:40 +0000 (UTC) (envelope-from brooks@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749664480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qkgrsN+aM3km+7/0pj/dM47UE8Oe9vIEEeNge92lVsk=; b=bqYrB4OmJ0+cKfqijbdmZhzIiL4Ve4+mCxLPrVayjgxS7+Ifu6/y7EHQIz1EeCTiJybTeS esP++woQqcTmHp0T1K/JpznyYHIPH53MIrT4GDQ2mKSiFXbHY6xIcTfeGJ1bnDvY/WFtFL /ddGW8dg2GQbNuccB638RtvN74I8E3neZ/uHTqbCNS0TVhRfAeG5/4cRwuxbkD8HPiv8A3 W/nBzMDTWibzY4sFXMGOUp0IwGdtcx+ud6pt14W/bHH697/8Fp/azjECJCzsIfzsLfm/iT PZeqRbvF2ywSPFdNYU6Oo6/6n2N4SD9fnohrKdbWgiqeb8sM/x56fUzLITTXxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749664480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qkgrsN+aM3km+7/0pj/dM47UE8Oe9vIEEeNge92lVsk=; b=qyIhYRWfLjD6UslbxReEEwSswI9q63Bap/tIlY2YuKbeXTXsEhGU5D1/ln3EQ92MQk1kT6 W/gdMaAHdmr2p1F8MIfR6omIM+JJw4zfrtbRCgAyV+NXLpQHOkT7TH4b3UH4pNwOlzYGls gT6aAxSI6ZKTe7Yvlvlx5DGQh22O4LvgvL3yMhgYsUh20tmoPvmTuUl1YNpmGGaeNZkIl1 kWYWTcTI+vCgK0tMKks/dLCXfB39GakFRaIpRBecHVoBGK5bVzKRAVY8NTxWGUhAUCBVKu rTuwtgDcQpN3Y+MuUvE3bRaCg95WaNMx+d0qWQALXXfbU79Suy2d1E8p3bz8ig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749664480; a=rsa-sha256; cv=none; b=VJuyVo42HbTwVSInE+Ll5gIgQobaGsG+6cWo1KVR+tt8ZPxWaTqL0ownkCNkmDsd9GxVPB ncBE4hxz/eecu439T8h+FZ7+Gdd3CaSn16MnrZDobgr69J3b0zHOkPDuxx81FAx1u4YfIP wO8h+5EuhlVUZ1322nkH2bzzdD6wFvzRafjBuddHEw7bjz1zGg84L0Kvq3C+7JdqVwxmRc qVvyZYZyUxTBYrit25Pkxl6Jxs2mfd78pi8QiHxA72jZxitTOudUEeyCzRWmlIH2uqkIzS BZ9c0BV7YtwDmEezg2GxK1KEOn6FbaF92RtIojOojRpbUNbIOMLcie2TNdkDyw== Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: brooks/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bHYFr1G8cz17Nf; Wed, 11 Jun 2025 17:54:40 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id C6A8E3C01A0; Wed, 11 Jun 2025 17:54:39 +0000 (UTC) Date: Wed, 11 Jun 2025 17:54:39 +0000 From: Brooks Davis To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: ab3d713e93dc - main - sys/_types.h: use builtins to for __max_align_t Message-ID: References: <202506111700.55BH0Ka6042574@gitrepo.freebsd.org> <37D99680-366D-4D11-BC19-B6D676FA1E22@freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <37D99680-366D-4D11-BC19-B6D676FA1E22@freebsd.org> On Wed, Jun 11, 2025 at 06:05:47PM +0100, Jessica Clarke wrote: > On 11 Jun 2025, at 18:00, Brooks Davis wrote: > > > > The branch main has been updated by brooks: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=ab3d713e93dc1d322398657125071101c08e2ce5 > > > > commit ab3d713e93dc1d322398657125071101c08e2ce5 > > Author: Brooks Davis > > AuthorDate: 2025-06-11 16:39:01 +0000 > > Commit: Brooks Davis > > CommitDate: 2025-06-11 16:39:01 +0000 > > > > sys/_types.h: use builtins to for __max_align_t > > > > Use __attribute__((__aligned__(x))) and __alignof__(x) in places of local > > macros that ultimately wrap these. We don't support compilers that don't > > define these so there's little loss of generality. > > > > This mirrors Clang's stddef.h. > > > > Reviewed by: imp > > Exp-run by: antoine (PR 286274) > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1595 > > --- > > sys/sys/_types.h | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/sys/sys/_types.h b/sys/sys/_types.h > > index c84b84edd2b8..f6d1f26551e0 100644 > > --- a/sys/sys/_types.h > > +++ b/sys/sys/_types.h > > @@ -181,9 +181,11 @@ typedef __uint_least32_t __char32_t; > > #endif > > > > typedef struct { > > - long long __max_align1 __aligned(_Alignof(long long)); > > + long long __max_align1 > > + __attribute__((__aligned__(__alignof__(long long)))); > > #ifndef _STANDALONE > > - long double __max_align2 __aligned(_Alignof(long double)); > > + long double __max_align2 > > + __attribute__((__aligned__(__alignof__(long long)))); > > #endif > > } __max_align_t; > > > > _Alignof is the standard C spelling of it. We should be adopting the > standard names for things more, polyfilling with GNU macros when not > available, not increasing our use of old GNU C equivalents that predate > their additions to the standard. This should really be > _Alignas(_Alignof(...)). Hmm, probably hoisting _Alignas and _Alignof into a sys/_stdalign.h would work well here. -- Brooks