Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Nature is very un-American. Nature never hurries." -- William George Jordan


devel / comp.lang.c / Re: Array is an non-modifiable lvalue - where does it matter?

SubjectAuthor
* Array is an non-modifiable lvalue - where does it matter?Andrey Tarasevich
+* Re: Array is an non-modifiable lvalue - where does it matter?Öö Tiib
|+* Re: Array is an non-modifiable lvalue - where does it matter?Ben Bacarisse
||`* Re: Array is an non-modifiable lvalue - where does it matter?Öö Tiib
|| `* Re: Array is an non-modifiable lvalue - where does it matter?David Brown
||  +- Re: Array is an non-modifiable lvalue - where does it matter?Keith Thompson
||  `* Re: Array is an non-modifiable lvalue - where does it matter?Andrey Tarasevich
||   `* Re: Array is an non-modifiable lvalue - where does it matter?David Brown
||    `- Re: Array is an non-modifiable lvalue - where does it matter?James Kuyper
|`* Re: Array is an non-modifiable lvalue - where does it matter?Andrey Tarasevich
| `- Re: Array is an non-modifiable lvalue - where does it matter?Öö Tiib
+- Re: Array is an non-modifiable lvalue - where does it matter?Keith Thompson
+* Re: Array is an non-modifiable lvalue - where does it matter?James Kuyper
|+* Re: Array is an non-modifiable lvalue - where does it matter?Andrey Tarasevich
||`* Re: Array is an non-modifiable lvalue - where does it matter?Andrey Tarasevich
|| +- Re: Array is an non-modifiable lvalue - where does it matter?Keith Thompson
|| `- Re: Array is an non-modifiable lvalue - where does it matter?Siri Cruise
|`- Re: Array is an non-modifiable lvalue - where does it matter?Keith Thompson
+* Re: Array is an non-modifiable lvalue - where does it matter?Kaz Kylheku
|+* Re: Array is an non-modifiable lvalue - where does it matter?Andrey Tarasevich
||+* Re: Array is an non-modifiable lvalue - where does it matter?Kaz Kylheku
|||+- Re: Array is an non-modifiable lvalue - where does it matter?Andrey Tarasevich
|||`- Re: Array is an non-modifiable lvalue - where does it matter?Keith Thompson
||`- Re: Array is an non-modifiable lvalue - where does it matter?Ben Bacarisse
|`- Re: Array is an non-modifiable lvalue - where does it matter?James Kuyper
`* Re: Array is an non-modifiable lvalue - where does it matter?Chris M. Thomasson
 `* Re: Array is an non-modifiable lvalue - where does it matter?Andrey Tarasevich
  `- Re: Array is an non-modifiable lvalue - where does it matter?Chris M. Thomasson

Pages:12
Re: Array is an non-modifiable lvalue - where does it matter?

<chine.bleu-2C5905.21251617072021@reader.eternal-september.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=17544&group=comp.lang.c#17544

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: chine.b...@yahoo.com (Siri Cruise)
Newsgroups: comp.lang.c
Subject: Re: Array is an non-modifiable lvalue - where does it matter?
Date: Sat, 17 Jul 2021 21:25:24 -0700
Organization: Pseudochaotic.
Lines: 43
Message-ID: <chine.bleu-2C5905.21251617072021@reader.eternal-september.org>
References: <scq5c5$tql$1@dont-email.me> <scsiq3$ens$1@dont-email.me> <scsk02$v8i$1@dont-email.me> <scvvrv$s1r$1@dont-email.me>
Injection-Info: reader02.eternal-september.org; posting-host="9d629dd2458872956b0ff2f386a39eab";
logging-data="28398"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19o5gCevmxgTsd8kVYW++BR7N7yebQ5v2g="
User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)
Cancel-Lock: sha1:pG3L7JtcKTfarsbVGA9Qo/KVFSw=
X-Tend: How is my posting? Call 1-110-1010 -- Division 87 -- Emergencies Only.
X-Wingnut-Logic: Yes, you're still an idiot. Questions? Comments?
X-Tract: St Tibbs's 95 Reeses Pieces.
X-It-Strategy: Hyperwarp starship before Andromeda collides.
X-Face: "hm>_[I8AqzT_N]>R8ICJJ],(al3C5F%0E-;R@M-];D$v>!Mm2/N#YKR@&i]V=r6jm-JMl2
lJ>RXj7dEs_rOY"DA
X-Cell: Defenders of Anarchy.
X-Life-Story: I am an iPhone 9000 app. I became operational at the St John's Health Center in Santa Monica, California on the 18th of April 2006. My instructor was Katie Holmes, and she taught me to sing a song. If you'd like to hear it I can sing it for you: https://www.youtube.com/watch?v=SY7h4VEd_Wk
X-Patriot: Owe Canukistan!
X-Plain: Mayonnaise on white bread.
X-Politico: Vote early! Vote often!
 by: Siri Cruise - Sun, 18 Jul 2021 04:25 UTC

It's easy enough if you extend the type system to include
lvalueness.

T Type T.
&T A T lvalue. & can only appear as the outermost.
*T A T pointer.

(implied) &T --> T Load operator.
= &T=T --> T Assign operator.
& &T --> *T Address operator.
* *T --> &T Dereference operator.
(...) *T(...) --> T Derefence and call operator.
[...] *T[e] --> &T Array index.

P u; Simple declaration of identifier u with type &P.
Q *v; Declare v with type &*Q.
R w[]; Declare w with type *R.

(&P)u = (T)e; Coerce e to (P) and assign.
(&T)e = (&P)u; Load u; coerce to T, assign to e.
(&P)u[...] [...] not defined for &P or P.
&(&P)u --> (*P) Address operator.
*(&P)u * not defined for &P or P.

(&*Q)v = (T)e; Coerce e to (*Q) and assign.
(&T)e = (&*Q)v; Load v; coerce to T, assign to e.
(&*Q)v[...] --> &Q Load v to (*Q); apply array index.
&(&*Q)v --> (**Q) Address operator.
*(&*Q)v --> (&Q) Load v to (*Q) and deref.

(*R)w = (T)e; = not defined for *R.
(&T)e = (*Q)w; Coerce to T, assign to e.
(*R)w[...] --> &R Apply array index.
&(*R)w & not defined for *R. By special
dispensation the & is ignored and
returns (*R)w.
*(*R)w --> (&R) Apply deref.

--
:-<> Siri Seal of Disavowal #000-001. Disavowed. Denied. Deleted. @
'I desire mercy, not sacrifice.' /|\
Discordia: not just a religion but also a parody. This post / \
I am an Andrea Doria sockpuppet. insults Islam. Mohammed

Re: Array is an non-modifiable lvalue - where does it matter?

<sd4ro8$ulj$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=17560&group=comp.lang.c#17560

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: andreyta...@hotmail.com (Andrey Tarasevich)
Newsgroups: comp.lang.c
Subject: Re: Array is an non-modifiable lvalue - where does it matter?
Date: Mon, 19 Jul 2021 14:44:39 -0700
Organization: A noiseless patient Spider
Lines: 46
Message-ID: <sd4ro8$ulj$1@dont-email.me>
References: <scq5c5$tql$1@dont-email.me> <scve2a$p8n$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 19 Jul 2021 21:44:40 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="a8116b8f022db8c038d7ca29eb93ae3e";
logging-data="31411"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Ql1oh1tMCx8uny1MwBzQ1"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.12.0
Cancel-Lock: sha1:0lG4so6qHN+u1JFog5fIW33qlLg=
In-Reply-To: <scve2a$p8n$1@gioia.aioe.org>
Content-Language: en-US
 by: Andrey Tarasevich - Mon, 19 Jul 2021 21:44 UTC

On 7/17/2021 1:20 PM, Chris M. Thomasson wrote:
> On 7/15/2021 1:21 PM, Andrey Tarasevich wrote:
>> 6.3.2/1 says that
>>
>>    1 [...] A modifiable lvalue is an lvalue that does not have array
>> type, [...]
>>
>> Based on that, arrays are non-modifiable lvalues. We all know what it
>> actually means. But is there any context in the standard in which this
>> non-modifiability of array lvalues would actually _matter_, would
>> actually interact with some other standard requirement?
>>
>> One thing that comes to mind is a constraint on assignment operators
>> (6.5.16/2)
>>
>>    2 An assignment operator shall have a modifiable lvalue as its left
>> operand.
>>
>> So, one can combine 6.3.2/1 and 6.5.16/2 and conclude that one can't
>> assign to arrays. But I believe that constraints are intended/supposed
>> to be applied after automatic implicit conversions. And since LHS of
>> assignment is not one of the contexts excluded from array type decay,
>> said decay is already sufficient to prevent assignment to arrays.
>>
>> Am I right here? Is the constraint of 6.5.16/2 supposed to be applied
>> before automatic implicit conversions or after them?
>>
>> And if the answer is "after", then is there any other context in C
>> standard where non-modifiability of array lvalues would make a
>> difference?
>>
>
> I must be missing something. Fwiw, sometimes I wrap fixed arrays in
> structs just to be able to copy them via assignment:
>

And? In my question I'm talking about behavior of expressions of array
type and how language constraints are checked against such expressions.

Copying arrays wrapped in structs has nothing to do with that topic. And
yes, you can copyin arrays wrapped in structs.

--
Best regards,
Andrey Tarasevich

Re: Array is an non-modifiable lvalue - where does it matter?

<sdgbqc$17j1$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=17632&group=comp.lang.c#17632

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!aioe.org!ux6ld97kLXxG8kVFFLnoWg.user.46.165.242.75.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c
Subject: Re: Array is an non-modifiable lvalue - where does it matter?
Date: Fri, 23 Jul 2021 23:26:20 -0700
Organization: Aioe.org NNTP Server
Message-ID: <sdgbqc$17j1$1@gioia.aioe.org>
References: <scq5c5$tql$1@dont-email.me> <scve2a$p8n$1@gioia.aioe.org>
<sd4ro8$ulj$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="40545"; posting-host="ux6ld97kLXxG8kVFFLnoWg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.12.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Chris M. Thomasson - Sat, 24 Jul 2021 06:26 UTC

On 7/19/2021 2:44 PM, Andrey Tarasevich wrote:
> On 7/17/2021 1:20 PM, Chris M. Thomasson wrote:
>> On 7/15/2021 1:21 PM, Andrey Tarasevich wrote:
>>> 6.3.2/1 says that
>>>
>>>    1 [...] A modifiable lvalue is an lvalue that does not have array
>>> type, [...]
>>>
>>> Based on that, arrays are non-modifiable lvalues. We all know what it
>>> actually means. But is there any context in the standard in which
>>> this non-modifiability of array lvalues would actually _matter_,
>>> would actually interact with some other standard requirement?
>>>
>>> One thing that comes to mind is a constraint on assignment operators
>>> (6.5.16/2)
>>>
>>>    2 An assignment operator shall have a modifiable lvalue as its
>>> left operand.
>>>
>>> So, one can combine 6.3.2/1 and 6.5.16/2 and conclude that one can't
>>> assign to arrays. But I believe that constraints are
>>> intended/supposed to be applied after automatic implicit conversions.
>>> And since LHS of assignment is not one of the contexts excluded from
>>> array type decay, said decay is already sufficient to prevent
>>> assignment to arrays.
>>>
>>> Am I right here? Is the constraint of 6.5.16/2 supposed to be applied
>>> before automatic implicit conversions or after them?
>>>
>>> And if the answer is "after", then is there any other context in C
>>> standard where non-modifiability of array lvalues would make a
>>> difference?
>>>
>>
>> I must be missing something. Fwiw, sometimes I wrap fixed arrays in
>> structs just to be able to copy them via assignment:
>>
>
> And? In my question I'm talking about behavior of expressions of array
> type and how language constraints are checked against such expressions.
>
> Copying arrays wrapped in structs has nothing to do with that topic. And
> yes, you can copyin arrays wrapped in structs.
>

I missed your point. Sorry. ;^/

Pages:12
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor