Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Oct 2016 16:00:01 +0200
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Brooks Davis <brooks@freebsd.org>
Cc:        John Baldwin <jhb@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r307756 - in head: include sys/sys
Message-ID:  <0C5786D6-EB91-4762-9FAB-4C447EAB0AF8@FreeBSD.org>
In-Reply-To: <20161022000056.GC95989@spindle.one-eyed-alien.net>
References:  <201610212350.u9LNo2PT031675@repo.freebsd.org> <20161022000056.GC95989@spindle.one-eyed-alien.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_22889CC7-FD96-4BA8-83DC-1798341EBBA8
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

On 22 Oct 2016, at 02:00, Brooks Davis <brooks@freebsd.org> wrote:
>=20
> On Fri, Oct 21, 2016 at 11:50:02PM +0000, John Baldwin wrote:
>> Author: jhb
>> Date: Fri Oct 21 23:50:02 2016
>> New Revision: 307756
>> URL: https://svnweb.freebsd.org/changeset/base/307756
>>=20
>> Log:
>>  Define max_align_t for C11.
>>=20
>>  libc++'s stddef.h includes an existing definition of max_align_t for
>>  C++11, but it is only defined for C++, not for C.  In addition, GCC =
and
>>  clang both define an alternate version of max_align_t that uses a
>>  union of multiple types rather than a plain long double as in =
libc++.
>>  This adds a __max_align_t to <sys/_types.h> that matches the GCC and
>>  clang definition that is mapped to max_align_t in <stddef.h>.
...
Modified: head/sys/sys/_types.h
>> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
>> --- head/sys/sys/_types.h	Fri Oct 21 21:55:50 2016	=
(r307755)
>> +++ head/sys/sys/_types.h	Fri Oct 21 23:50:02 2016	=
(r307756)
>> @@ -100,6 +100,11 @@ typedef	__uint_least32_t __char32_t;
>> #define	_CHAR32_T_DECLARED
>> #endif
>>=20
>> +typedef struct {
>=20
> Should this be union per the commit message?

You would be inclined to think so, but the strange way this is defined
is only to be compatible with gcc's definition, which was introduced
here in 2011:

=
https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/ginclude/stddef.h?r1=3D181048&r2=
=3D181047&pathrev=3D181048


> Ideally I'd add a void * as well since that will support systems like
> CHERI where pointers are the largest type.

Is void * larger than a struct with long long and long double?  I'd
think this would be at least 128 bits on almost all architectures?

In any case, if you want to change this definition, it is probably best
to first check it with upstream gcc, otherwise you'll end up with an
incompatibility.

-Dimitry


--Apple-Mail=_22889CC7-FD96-4BA8-83DC-1798341EBBA8
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.30

iEYEARECAAYFAlgLcOkACgkQsF6jCi4glqMwaQCfSjtamAUoC7N1raA1m4KXJQ/h
MgcAn22khZQ9Ou3ozpMGSm6LJoqOAWcE
=nXwd
-----END PGP SIGNATURE-----

--Apple-Mail=_22889CC7-FD96-4BA8-83DC-1798341EBBA8--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0C5786D6-EB91-4762-9FAB-4C447EAB0AF8>