Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c++
Subject: Re: std::atomic::is_lock_free()
Date: Thu, 28 Nov 2019 15:44:53 -0800
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <864kyna7m2.fsf@linuxsc.com>
References: <3b58b4dd-b63a-46c6-8e4f-9ccfe0328d15@googlegroups.com> <98e27cbe-79a4-4875-8aaa-a45c1eab293d@googlegroups.com> <4a9ef580-84eb-4782-8d9a-440504086ca1@googlegroups.com> <633f2371-1a23-4ba5-a2ac-1de2b8109a9b@googlegroups.com> <3d0d466e-34ea-458a-9933-045be32bbf39@googlegroups.com> <86721e66-6079-42a0-8be5-be8342a6f4f3@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="81b92e3fa8397acac1ab5cf195ff75cd"; logging-data="8012"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19t4dFogjXmK+MX6W+kN6qTS8N7QckzuZo="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:hx8Cdg0WsRIpCw9H45pNg3Hrnow= sha1:s1GWAFJ4FDXp6qWb80af0uELQoQ=
Xref: csiph.com comp.lang.c++:70100
Tiib writes:
> On Monday, 18 November 2019 08:52:27 UTC+2, Bonita Montero wrote:
>
>>>>> Nonsense. What is aligned or misaligned is up to compiler
>>>>> itself to decide.
>>>>
>>>> Wrong. If you pack your members tighter than alignof(membertype)
>>>> allows this is not conforming.
>>>
>>> That is a bald and groundless assertion.
>>
>> "Object types have alignment requirements (6.9.1, 6.9.2) which place
>> restrictions on the addresses at which an object of that type may be
>> allocated. ...
>
> ...
> The alignment required for a type might be different when it is used
> as the type of a complete object and when it is used as the type of
> a subobject.
> ...
No it cannot. Refer to n4659, section 6.11, paragraph 1. Note
in particular the last sentence, which says in part (with my
emphasis added):
An object type imposes an alignment requirement on EVERY
OBJECT of that type
There is no provision for the alignment varying according to
whether the object is a complete object or a subobject.