Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Kaz Kylheku <643-408-1753@kylheku.com> Newsgroups: comp.lang.c Subject: Re: technology discussion =?UTF-8?Q?=E2=86=92?= does the world need a "new" C ? Date: Fri, 12 Jul 2024 12:14:40 -0000 (UTC) Organization: A noiseless patient Spider Lines: 66 Message-ID: <20240712045301.394@kylheku.com> References: <87h6d2uox5.fsf@nosuchdomain.example.com> <20240707164747.258@kylheku.com> <877cdur1z9.fsf@bsb.me.uk> <871q42qy33.fsf@bsb.me.uk> <87ed82p28y.fsf@bsb.me.uk> <87r0c1nzjj.fsf@bsb.me.uk> <87ikxconq4.fsf@bsb.me.uk> <20240711115418.00001cdf@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 12 Jul 2024 14:14:40 +0200 (CEST) Injection-Info: dont-email.me; posting-host="ce9d7750f6a622c8d90995dce7832ee4"; logging-data="3164361"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18kDuQQxmoIfhGWxvKBkT3SHDpIfDUapAc=" User-Agent: slrn/pre1.0.4-9 (Linux) Cancel-Lock: sha1:KDPNVbBIgbomy9u204CNka4fiHI= Bytes: 4074 On 2024-07-12, bart wrote: > It's clearly not by value. It's apparently not by reference. You can't > get away with saying they are not passed, as clearly functions *can* > access array data via parameters. Actually, you probably can get away with saying that it is "passed by reference". The formal term that doesn't apply is "call by reference"; that's what C doesn't have. "call by reference" emphasizes that the function call mechanism provides the reference semantics for a formal parameter, not that some arbitrary means of passage of the data has reference semantics. The following also achieves "pass by reference": int *global; void child(void) { printf("%d\", global[13]); } void parent(void) { int array[20]; global = array; child(); } "pass" does not mean as a formal parameter. For instance "message passing" (e.g. from one thread to another) doesn't use formal parameters. ISO C uses the "refer" word and derivatives thereof in connection with pointers: - "If an attempt is made to refer to an object defined with a volatile-qualified type through use of an lvalue with non-volatile-qualified type, the behavior is undefined". The type from which a pointer is derived is called the "referenced type": - "The construction of a pointer type from a referenced type is called ‘‘pointer type derivation’’ [C99] A footnote in C99 used the word "dereferencing" to describe the action of the unary * operator. This word is commonly used in the C programming circles: - "Among the invalid values for dereferencing a pointer by the unary * operator are a null pointer, ..." Another footnote in C99 uses "referenced" describing the relationship of an pointer to the target object: - "In other words, E depends on the value of P itself rather than on the value of an object referenced indirectly through P. -- TXR Programming Language: http://nongnu.org/txr Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal Mastodon: @Kazinator@mstdn.ca