Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/kern



On 07.11.2019 17:20, Kamil Rytarowski wrote:
> On 07.11.2019 17:08, Martin Husemann wrote:
>> On Thu, Nov 07, 2019 at 04:56:16PM +0100, Kamil Rytarowski wrote:
>>> 6.3.2.1 C11
>>>
>>> 'An lvalue is an expression (with an object type other than void) that
>>> potentially designates an object'
>>>
>>> This means that real dereference is not needed, only a potential. And
>>> there are special cases of pointer arithmetic.
>>
>> But 6.5.3.2 says that taking the address of a pointer expression does
>> not "evaluate the * oparator", but instead is shortcut to address addition.
>>
> 
> I think that this does not apply as & is applied already to lvalue. This
> part of standard specifies &*p, not something like &((*p).x).
> 

To be clear the third case (next to applying to * and lvalue) is
applying & to the result of []. Unfortunately p->x goes into the lvalue
section.

This is how I interpret it (and find it as unreasonable in practice).

>> The annotations talk about various special cases and not the concreate one
>> at hand, but in my reading the intention is clear and this part should be
>> clarified.
>>
> 
> I can agree that this would be nicer to be defined, unfortunately I
> think that we can merely ask for exception to apply & to -> operator.
> 
>> Martin
>>
> 
> 


Attachment: signature.asc
Description: OpenPGP digital signature



Home | Main Index | Thread Index | Old Index