Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: bart Newsgroups: comp.lang.c Subject: =?UTF-8?Q?Re=3A_technology_discussion_=E2=86=92_does_the_world_need?= =?UTF-8?B?IGEgIm5ldyIgQyA/?= Date: Thu, 11 Jul 2024 21:37:40 +0100 Organization: A noiseless patient Spider Lines: 35 Message-ID: References: <877cdur1z9.fsf@bsb.me.uk> <871q42qy33.fsf@bsb.me.uk> <87ed82p28y.fsf@bsb.me.uk> <87r0c1nzjj.fsf@bsb.me.uk> <86ikxd8czu.fsf@linuxsc.com> <20240710213910.00000afd@yahoo.com> <865xtc87yo.fsf@linuxsc.com> <87msmnu5e3.fsf@nosuchdomain.example.com> <87frsfu0yp.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 11 Jul 2024 22:37:40 +0200 (CEST) Injection-Info: dont-email.me; posting-host="92757c0b3eb137c08e71ba54311788f0"; logging-data="2738804"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX180ALDkFyce3NsF44CO9bf1" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:OMandrtmAnckNWU6rh4Tngaazyg= In-Reply-To: <87frsfu0yp.fsf@nosuchdomain.example.com> Content-Language: en-GB Bytes: 3011 On 11/07/2024 21:29, Keith Thompson wrote: > bart writes: >> On 11/07/2024 19:53, Keith Thompson wrote: >>> bart writes: >>> [...] >>>> For that purpose, in the mind of the user, it does the same job as 'by >>>> by reference'. That it does so by some other quirks (array decay, and >>>> the ability to index pointers as thought they were arrays), is by the >>>> by. >>> [...] >>> Those "quirks" are a rich source of confusion and bugs for anyone >>> who >>> doesn't understand how this stuff is actually defined. (Yes, I'm >>> acknowledging, yet again, that the way C specifies its treatment of >>> arrays is confusing.) >>> A user who thinks that arrays are simply "passed by reference" is >>> likely >>> to try to apply sizeof to an array parameter (and might or might not get >>> a diagnostic from the compiler). A slightly more sophisticated user is >>> still likely to be unsure of just where the "quirks" are. >>> What have you ever done to help make that kind of error less likely? >>> What is your goal? >> >> >> This my first comment on the subject: >> >> "Arrays are passed by reference: >> ... >> Although ..." > > And that statement was incorrect, even with the "Although". So arrays are passed by value? Gotcha.