Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Remember the good old days, when CPU was singular?


devel / comp.lang.c / Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

SubjectAuthor
* "Catch-23: The New C Standard,Sets the World on Fire" by TerenceLynn McGuire
+* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceJim Kelly
|`- Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceLynn McGuire
+* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Rene Kita
|`* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Kenny McCormack
| +- Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Scott Lurndal
| `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Rene Kita
|  `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Kenny McCormack
|   +* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Dan Cross
|   |+* (realloc) Angels and pins (Was: "Catch-23: The New C Standard,Sets the World on Kenny McCormack
|   ||`- Re: (realloc) Angels and pins (Was: "Catch-23: The New C Standard,Sets the WorldDan Cross
|   |`* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Ben Bacarisse
|   | +- Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Dan Cross
|   | `- Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Tim Rentsch
|   `- Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceDavid Brown
+* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceDan Cross
|`* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceLynn McGuire
| `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Ben Bacarisse
|  +* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Dan Cross
|  |+- Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceOpus
|  |+* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Ben Bacarisse
|  ||+* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Dan Cross
|  |||+* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceDavid Brown
|  ||||+- Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Scott Lurndal
|  ||||+- Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Keith Thompson
|  ||||+* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceDan Cross
|  |||||`* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceDavid Brown
|  ||||| +* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Keith Thompson
|  ||||| |`- Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Tim Rentsch
|  ||||| `- Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceDan Cross
|  ||||`* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with John Forkosh
|  |||| +- Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceDavid Brown
|  |||| `* Re: "Catch-23: The New C Standard,Sets the World on Fire" byKaz Kylheku
|  ||||  `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Tim Rentsch
|  ||||   +* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terencejak
|  ||||   |+* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceDan Cross
|  ||||   ||+* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terencejak
|  ||||   |||`* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceDan Cross
|  ||||   ||| +* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terencejak
|  ||||   ||| |+* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceJames Kuyper
|  ||||   ||| ||`* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terencejak
|  ||||   ||| || +- Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceJames Kuyper
|  ||||   ||| || `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceMalcolm McLean
|  ||||   ||| ||  `- Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Keith Thompson
|  ||||   ||| |`* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Keith Thompson
|  ||||   ||| | `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceBart
|  ||||   ||| |  +- Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Keith Thompson
|  ||||   ||| |  `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Ben Bacarisse
|  ||||   ||| |   `- Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceBart
|  ||||   ||| +* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceJames Kuyper
|  ||||   ||| |+* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceDan Cross
|  ||||   ||| ||`* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceJames Kuyper
|  ||||   ||| || `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceDan Cross
|  ||||   ||| ||  +* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceJames Kuyper
|  ||||   ||| ||  |`- Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceDan Cross
|  ||||   ||| ||  `- Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Tim Rentsch
|  ||||   ||| |`* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Spiros Bousbouras
|  ||||   ||| | `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceJames Kuyper
|  ||||   ||| |  `- Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceDan Cross
|  ||||   ||| `- Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Tim Rentsch
|  ||||   ||`* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceJames Kuyper
|  ||||   || `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceDan Cross
|  ||||   ||  `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceJames Kuyper
|  ||||   ||   `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceDan Cross
|  ||||   ||    `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceJames Kuyper
|  ||||   ||     `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceDan Cross
|  ||||   ||      `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceJames Kuyper
|  ||||   ||       `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Kalevi Kolttonen
|  ||||   ||        `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceBart
|  ||||   ||         `- Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Kalevi Kolttonen
|  ||||   |+* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Keith Thompson
|  ||||   ||`* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terencejak
|  ||||   || +* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceJames Kuyper
|  ||||   || |+* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terencejak
|  ||||   || ||+* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terencejak
|  ||||   || |||+* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceJames Kuyper
|  ||||   || ||||`* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terencejak
|  ||||   || |||| +* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceJames Kuyper
|  ||||   || |||| |`* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terencejak
|  ||||   || |||| | +* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceÖö Tiib
|  ||||   || |||| | |`* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terencejak
|  ||||   || |||| | | +* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Keith Thompson
|  ||||   || |||| | | |`* Re: "Catch-23: The New C Standard,Sets the World on Fire" byIke Naar
|  ||||   || |||| | | | +* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Ben Bacarisse
|  ||||   || |||| | | | |`- Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceÖö Tiib
|  ||||   || |||| | | | `- Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceJames Kuyper
|  ||||   || |||| | | `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceÖö Tiib
|  ||||   || |||| | |  `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terencejak
|  ||||   || |||| | |   `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceJames Kuyper
|  ||||   || |||| | |    +- Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceJames Kuyper
|  ||||   || |||| | |    `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Tim Rentsch
|  ||||   || |||| | |     `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terencejames...@alumni.caltech.edu
|  ||||   || |||| | |      +- Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceDavid Brown
|  ||||   || |||| | |      `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Tim Rentsch
|  ||||   || |||| | |       `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terencejames...@alumni.caltech.edu
|  ||||   || |||| | |        `- Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Tim Rentsch
|  ||||   || |||| | +- Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceJames Kuyper
|  ||||   || |||| | +* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terencejak
|  ||||   || |||| | |+* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Scott Lurndal
|  ||||   || |||| | ||+* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terencejak
|  ||||   || |||| | |||`* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terencejak
|  ||||   || |||| | ||+- Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Keith Thompson
|  ||||   || |||| | ||`- Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceJames Kuyper
|  ||||   || |||| | |`- Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceJames Kuyper
|  ||||   || |||| | +* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Keith Thompson
|  ||||   || |||| | `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceDavid Brown
|  ||||   || |||| `- Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Keith Thompson
|  ||||   || |||`- Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Keith Thompson
|  ||||   || ||`* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceJames Kuyper
|  ||||   || |`- Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Tim Rentsch
|  ||||   || `- Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Keith Thompson
|  ||||   |`- Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Tim Rentsch
|  ||||   `* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Ben Bacarisse
|  |||`- Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Ben Bacarisse
|  ||`- Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Tim Rentsch
|  |+* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Tim Rentsch
|  |`* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Phil Carmody
|  +* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Lowell Gilbert
|  +* Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Tim Rentsch
|  `- Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Tim Rentsch
+- Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceBonita Montero
`* Re: "Catch-23: The New C Standard,Sets the World on Fire" by TerenceMichael S

Pages:12345678
Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<u11aqa$27na5$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: nos...@please.ty (jak)
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence
Kelly with Special Guest Borer Yekai Pan
Date: Mon, 10 Apr 2023 17:43:06 +0200
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <u11aqa$27na5$1@dont-email.me>
References: <u0fn0g$34scf$1@dont-email.me> <87zg7n89zw.fsf@bsb.me.uk>
<u0ig61$64g$1@reader2.panix.com> <874jpv84uv.fsf@bsb.me.uk>
<u0jt3l$cmu$1@reader2.panix.com> <u0k3au$3uelq$1@dont-email.me>
<u0lm3j$8iu$1@reader2.panix.com> <20230407042121.909@kylheku.com>
<86r0st3zj0.fsf@linuxsc.com> <u0uk66$1or41$1@dont-email.me>
<871qkshmhv.fsf@nosuchdomain.example.com> <u10dvr$23np8$1@dont-email.me>
<u11404$26gpq$1@dont-email.me> <u116gd$273m1$1@dont-email.me>
<u116uf$275ph$1@dont-email.me> <u119q9$27go7$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 10 Apr 2023 15:43:06 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="324c3efb794bc08f3c95a3facab56a11";
logging-data="2350405"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+XCfaIrk5r0wOr5qcJikGT"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.16
Cancel-Lock: sha1:Eo8SZhSV2nTRa2BUnO2oTMUz4+U=
In-Reply-To: <u119q9$27go7$3@dont-email.me>
 by: jak - Mon, 10 Apr 2023 15:43 UTC

James Kuyper ha scritto:
> On 4/10/23 10:37, jak wrote:
> ...
>>> Instead, explain to me why, after all the improvements introduced by the
>> standards, it is no longer possible to declare a specialized function
>> pointer array without first declaring the typedef that defines the
>> function pointer and why.
>
> "specialized function pointer array"? Are you posting that to the
> correct newsgroup?
> Even if this were comp.lang.c++, you've just swerved off into an
> entirely different conversational direction - I would recommend starting
> a new thread to discuss that issue.
>

Please tell me you're joking...

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<u11b4s$27go8$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence
Kelly with Special Guest Borer Yekai Pan
Date: Mon, 10 Apr 2023 11:48:44 -0400
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <u11b4s$27go8$2@dont-email.me>
References: <u0fn0g$34scf$1@dont-email.me> <u0uk66$1or41$1@dont-email.me>
<u0v3vh$df3$1@reader2.panix.com> <u10erc$23rhg$1@dont-email.me>
<u117rb$9r2$2@reader2.panix.com> <u11a0u$27j9d$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 10 Apr 2023 15:48:44 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="585a2b92344e96b538cef7b9f0a43c30";
logging-data="2343688"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19X9ZcLZLSvaAx3D0aSBQvoMvUh8h/HzgE="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.9.0
Cancel-Lock: sha1:MNGFyAz21dtlJ/+Hi6Zn1NihwLc=
Content-Language: en-US
In-Reply-To: <u11a0u$27j9d$1@dont-email.me>
 by: James Kuyper - Mon, 10 Apr 2023 15:48 UTC

On 4/10/23 11:29, jak wrote:
....
> char val;
> int *pi;
>
> pi = (int *)&val;
>
> because if you assigned a value to *pi you would be using unallocated
> memory

The problem with that code has nothing to do with the problem Tim was
talking about, nor does it have anything to do with unallocated memory.
It has undefined behavior if &val points to a memory location that is
not correctly aligned to hold an 'int' (6.3.2.3p7). More importantly,
even if it is correctly aligned, the value stored in pi cannot be used
to access an 'int', because it doesn't point at an int object.

> ... and if you really want to do that you need a left cast:
>
> ((char *)pi) = &val;

The left hand side of an assignment is required to be a modifiable
lvalue (6.5.16p2). The result of a pointer conversion is not an lvalue.

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<u11bll$27m86$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence
Kelly with Special Guest Borer Yekai Pan
Date: Mon, 10 Apr 2023 11:57:41 -0400
Organization: A noiseless patient Spider
Lines: 69
Message-ID: <u11bll$27m86$1@dont-email.me>
References: <u0fn0g$34scf$1@dont-email.me> <u10erc$23rhg$1@dont-email.me>
<u117rb$9r2$2@reader2.panix.com> <u11aau$27go8$1@dont-email.me>
<u11afa$1jl$2@reader2.panix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 10 Apr 2023 15:57:41 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="585a2b92344e96b538cef7b9f0a43c30";
logging-data="2349318"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19kK1LN2EKH4cw6+GH2E1JahJcoQ4lWzoc="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.9.0
Cancel-Lock: sha1:+ldvwpBwxN79MMT5F4cIoSqUIbE=
Content-Language: en-US
In-Reply-To: <u11afa$1jl$2@reader2.panix.com>
 by: James Kuyper - Mon, 10 Apr 2023 15:57 UTC

On 4/10/23 11:37, Dan Cross wrote:
> In article <u11aau$27go8$1@dont-email.me>,
> James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
>> On 4/10/23 10:52, Dan Cross wrote:
>>> In article <u10erc$23rhg$1@dont-email.me>, jak <nospam@please.ty> wrote:
>>>> Dan Cross ha scritto:
>>>>> In article <u0uk66$1or41$1@dont-email.me>, jak <nospam@please.ty>
>>>>> wrote:
>>>>>> Tim Rentsch ha scritto:
>>>>>>> [snip]
>>>>>>> I agree with the general tone of this suggestion. Unfortunately
>>>>>>> however the particular code suggested might not compile (because
>>>>>>> the macro NULL might be #define'd to be 0, which can result in an
>>>>>>> error). Writing the function this way:
>>>>>>>
>>>>>>> void *
>>>>>>> realloc0( void *p, size_t size ){
>>>>>>> return size == 0 ? free( p ), p = 0 : realloc( p, size );
>>>>>>> }
>>>>>>>
>>>>>>> is an easy way to avoid that implementation dependency.
>>>>>>
>>>>>> If you absolutely wanted to avoid dependency, perhaps you
>>>>>> shouldn't rely
>>>>>> on autocast and use an explicit one instead.
>>>>>
>>>>> What "dependency" would that avoid, other than a dependency on
>>>>> the C standard?
>>>>
>>>> Why are you asking me this?
>>>
>>> Because you are the one who suggested there is some kind of
>>> "dependency" in Tim's code?
>>
>> The comment about "implementation dependency" was written by Tim, jak
>> was merely referring to that comment.
>
> It seemed that jak was suggesting that in Tim's forumulation,
> one should cast the 0 in p = 0, as in `p = (void *)0`.

I don't think so. I believe that he was suggesting that it would be
preferable to rewrite Kaz's formulation as "free(ptr), (void*)NULL", or
simply "free(ptr), (void*)0", which would avoid the implementation
dependency. I took this as a suggestion of style, rather than implying
that it was necessary. The fact that "p=0" implicitly converts 0 to 'p's
type, and is the value of the assignment expression, is a little too
subtle for Jak, and I can see his point.

>>>> Perhaps you consider being portability if
>>>> you move the source code to another machine with the same operating
>>>> system, same compiler, same compiler version.
>>>
>>> This has nothing to do with that. Tim's code was correct and
>>> portable.
>>
>> Tim's comment about an implementation dependency was written about code
>> written by Kaz Kylheku. That code does indeed have an implementation
>> dependency. Depending upon which choice an implementation makes for the
>> null pointer constant that NULL expands into, Kaz's code might or might
>> not contain a constraint violation.
>
> That was not what I was referring to; see above and please note
> the exact words I responded to (specifically the post that
> referred to "autocast").

Jak's comment using the phrase "autocast" was not referring to any
implementation dependency in Tim's code, only to the same implementation
dependency in Kaz's code that Tim himself was talking about.

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<u11bmg$27rcs$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: nos...@please.ty (jak)
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence
Kelly with Special Guest Borer Yekai Pan
Date: Mon, 10 Apr 2023 17:58:08 +0200
Organization: A noiseless patient Spider
Lines: 49
Message-ID: <u11bmg$27rcs$1@dont-email.me>
References: <u0fn0g$34scf$1@dont-email.me> <87zg7n89zw.fsf@bsb.me.uk>
<u0ig61$64g$1@reader2.panix.com> <874jpv84uv.fsf@bsb.me.uk>
<u0jt3l$cmu$1@reader2.panix.com> <u0k3au$3uelq$1@dont-email.me>
<u0lm3j$8iu$1@reader2.panix.com> <20230407042121.909@kylheku.com>
<86r0st3zj0.fsf@linuxsc.com> <u0uk66$1or41$1@dont-email.me>
<871qkshmhv.fsf@nosuchdomain.example.com> <u10dvr$23np8$1@dont-email.me>
<u11404$26gpq$1@dont-email.me> <u116gd$273m1$1@dont-email.me>
<u119hk$27go7$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 10 Apr 2023 15:58:08 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="324c3efb794bc08f3c95a3facab56a11";
logging-data="2354588"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+lN7opC9yKtFVhBZx1u78E"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.16
Cancel-Lock: sha1:cBAK9gWlmVj7vTO3Ybx49m7jfqk=
In-Reply-To: <u119hk$27go7$2@dont-email.me>
 by: jak - Mon, 10 Apr 2023 15:58 UTC

James Kuyper ha scritto:
> On 4/10/23 10:29, jak wrote:
>> James Kuyper ha scritto:
>>> On 4/10/23 03:31, jak wrote:
>>>> Keith Thompson ha scritto:
>>>>> jak <nospam@please.ty> writes:
>>>>> [...]
>>>>>> If you absolutely wanted to avoid dependency, perhaps you shouldn't rely
>>>>>> on autocast and use an explicit one instead.
>>>>>
>>>>> I've never seen the term "autocast" before.
>>>>>
>>>>> A cast is an explicit conversion. A conversion done without a cast is
>>>>> an implicit conversion. "Autocast" would be a contradiction.
>>>>>
>>>>
>>>> Maybe this is because we don't come from the same county and therefore,
>>>> probably, haven't read the same books? I don't formalize myself nor am I
>>>> shocked when I read 'implicit conversion' despite the cast it should be
>>>> considered a stretch and not a conversion. Perhaps you too should have a
>>>> more open mind.
> ...
>>> The word "stretch" appears nowhere in the C standard. As a very
>>> well-read native speaker of English with a very good understanding of C,
>>> and a fairly good understanding of most programming jargon, I'm not sure
>>> what you mean by "stretch". None of the 10 meanings listed at
>>> wiktionary.org for "stretch" seems applicable.
>>> Would you care to describe what you mean by that term, and how it
>>> differs from a conversion? I haven't a clue.
> ...
>> Are you K.T's knight perhaps? Please stop quoting bits of manuals that
>> everyone has read hundreds of times, be less obtuse and learn to read
>> what is not written. Some field work wouldn't hurt. Do not hoe but claim
>> to design hoes.
>
> Are you referring to Keith Thompson? I am not his knight, whatever you
> might mean by that; we're just two people with similar attitudes about
> formal rigor, and as a result are often (but not always) in agreement
> about what the standard means.
> The standard is not a manual. I seriously doubt that you have read it
> hundreds of times.
> I remain unenlightened as to what "stretch" might mean in this context.
> I can't even imagine where I might look for a definition.
>
>
Keep your doubts close to you as well. I'm still ahead of you because I
know that I don't know.

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<Y8qq6QwnAovu5XLqP@bongo-ra.co>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: spi...@gmail.com (Spiros Bousbouras)
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan
Date: Mon, 10 Apr 2023 15:58:35 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 66
Message-ID: <Y8qq6QwnAovu5XLqP@bongo-ra.co>
References: <u0fn0g$34scf$1@dont-email.me> <u0uk66$1or41$1@dont-email.me> <u0v3vh$df3$1@reader2.panix.com>
<u10erc$23rhg$1@dont-email.me> <u117rb$9r2$2@reader2.panix.com> <u11aau$27go8$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 10 Apr 2023 15:58:35 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0e2a24fbd5f2fec597d17cd44f9251bd";
logging-data="2354733"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+XYVgZV2p5u7xxyFI2PS17"
Cancel-Lock: sha1:7RAwbGoSlmlSsFC753X21gzQgBc=
X-Organisation: Weyland-Yutani
X-Server-Commands: nowebcancel
In-Reply-To: <u11aau$27go8$1@dont-email.me>
 by: Spiros Bousbouras - Mon, 10 Apr 2023 15:58 UTC

On Mon, 10 Apr 2023 11:34:54 -0400
James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
> On 4/10/23 10:52, Dan Cross wrote:
> > In article <u10erc$23rhg$1@dont-email.me>, jak <nospam@please.ty> wrote:
> >> Dan Cross ha scritto:
> >>> In article <u0uk66$1or41$1@dont-email.me>, jak <nospam@please.ty> wrote:
> >>>> Tim Rentsch ha scritto:
> >>>>> [snip]
> >>>>> I agree with the general tone of this suggestion. Unfortunately
> >>>>> however the particular code suggested might not compile (because
> >>>>> the macro NULL might be #define'd to be 0, which can result in an
> >>>>> error). Writing the function this way:
> >>>>>
> >>>>> void *
> >>>>> realloc0( void *p, size_t size ){
> >>>>> return size == 0 ? free( p ), p = 0 : realloc( p, size );
> >>>>> }
> >>>>>
> >>>>> is an easy way to avoid that implementation dependency.
> >>>>
> >>>> If you absolutely wanted to avoid dependency, perhaps you shouldn't rely
> >>>> on autocast and use an explicit one instead.
> >>>
> >>> What "dependency" would that avoid, other than a dependency on
> >>> the C standard?
> >>
> >> Why are you asking me this?
> >
> > Because you are the one who suggested there is some kind of
> > "dependency" in Tim's code?
>
> The comment about "implementation dependency" was written by Tim, jak
> was merely referring to that comment.

Yes , but which piece of code was jak referring to ? For easy reference lets
call Code A

return (size == 0) ? free(ptr), NULL : realloc(ptr, size);

which posted by Kaz in <20230407042121.909@kylheku.com> and Code B

void *
realloc0( void *p, size_t size ){
return size == 0 ? free( p ), p = 0 : realloc( p, size );
}

which was posted by Tim in <86r0st3zj0.fsf@linuxsc.com> .So when jak said
"If you absolutely wanted to avoid dependency" which of the 2 code excerpts
was he referring to ? I took it to mean that he was referring to Code B and I
think Dan took it to mean the same. Code B does not have any "implementation
dependency" , it just relies on the C standard. In contrast , Code A may have
a constraint violation depending on how the implementation defines NULL , as
Tim pointed out.

> >> Perhaps you consider being portability if
> >> you move the source code to another machine with the same operating
> >> system, same compiler, same compiler version.
> >
> > This has nothing to do with that. Tim's code was correct and
> > portable.
>
> Tim's comment about an implementation dependency was written about code
> written by Kaz Kylheku. That code does indeed have an implementation
> dependency. Depending upon which choice an implementation makes for the
> null pointer constant that NULL expands into, Kaz's code might or might
> not contain a constraint violation.

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<u11c1o$27m86$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence
Kelly with Special Guest Borer Yekai Pan
Date: Mon, 10 Apr 2023 12:04:08 -0400
Organization: A noiseless patient Spider
Lines: 86
Message-ID: <u11c1o$27m86$2@dont-email.me>
References: <u0fn0g$34scf$1@dont-email.me> <u116a4$270uv$1@dont-email.me>
<u117os$9r2$1@reader2.panix.com> <u119gi$27go7$1@dont-email.me>
<u11aba$1jl$1@reader2.panix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 10 Apr 2023 16:04:08 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="585a2b92344e96b538cef7b9f0a43c30";
logging-data="2349318"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX190/aNeDJCdX957ik5yKYaflF519WyymnQ="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.9.0
Cancel-Lock: sha1:hkQS0baHxdxMH9nlCKWhHRA/u68=
In-Reply-To: <u11aba$1jl$1@reader2.panix.com>
Content-Language: en-US
 by: James Kuyper - Mon, 10 Apr 2023 16:04 UTC

On 4/10/23 11:35, Dan Cross wrote:
> In article <u119gi$27go7$1@dont-email.me>,
> James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
>> On 4/10/23 10:51, Dan Cross wrote:
>>> In article <u116a4$270uv$1@dont-email.me>,
>>> James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
>>>> On 4/9/23 15:34, Dan Cross wrote:
>>>>> In article <u0uk66$1or41$1@dont-email.me>, jak <nospam@please.ty>
>>>>> wrote:
>>>>>> Tim Rentsch ha scritto:
>>>>>>> [snip]
>>>>>>> I agree with the general tone of this suggestion. Unfortunately
>>>>>>> however the particular code suggested might not compile (because
>>>>>>> the macro NULL might be #define'd to be 0, which can result in an
>>>>>>> error). Writing the function this way:
>>>>>>>
>>>>>>> void *
>>>>>>> realloc0( void *p, size_t size ){
>>>>>>> return size == 0 ? free( p ), p = 0 : realloc( p, size );
>>>>>>> }
>>>>>>>
>>>>>>> is an easy way to avoid that implementation dependency.
>>>>>>
>>>>>> If you absolutely wanted to avoid dependency, perhaps you shouldn't
>>>>>> rely
>>>>>> on autocast and use an explicit one instead.
>>>>>
>>>>> What "dependency" would that avoid, other than a dependency on
>>>>> the C standard?
>>>>
>>>> The C standard merely requires that NULL expand to a null pointer
>>>> constant. It depends upon the implementation which null pointer
>>>> constant
>>>> it expands to. A null pointer constant necessarily has either an
>>>> integer
>>>> type or the type void*. The comma expression will have that same type.
>>>> An integer type results in a constraint violation, void* does not.
>>>> That's the implementation dependency that Tim was talking about.
>>>
>>> The C standard has been quite explicit that integer 0 is
>>> a valid null pointer constant since C89. Tim's code was
>>> correct and had no dependency.
>>
>> Correct. 0 is a valid null pointer constant. It has a type of int.
>> Therefore, the expression "free(p), 0' would have a value of 0 and a
>> type of int. The expression 'size == 0 ? NULL : realloc(p, size)" would
>> not be problematic because, in that context, a null pointer constant
>> gets implicitly converted to a null pointer with the same type as the
>> return value of realloc (6.5.15p7). However, function calls are not
>> allowed in integer constant expressions (6.6p6), so "free(p), 0" does
>> NOT qualify as an integer constant expression, and therefore also does
>> not qualify as a null pointer constant (6.3.2.3p3). A conditional
>> expression where the second operand has an arithmetic type, but does not
>> qualify as a null pointer constant, and a third operand that has pointer
>> type, doesn't match any of the permitted combinations listed in the
>> constraints on conditional expressions (6.5.15p3):
>>
>> "One of the following shall hold for the second and third operands:
>> ISO/IEC 9899:202x (E)
>> — both operands have arithmetic type;
>> — both operands have the same structure or union type;
>> — both operands have void type;
>> — both operands are pointers to qualified or unqualified versions of
>> compatible types;
>> — one operand is a pointer and the other is a null pointer constant; or
>> — one operand is a pointer to an object type and the other is a pointer
>> to a qualified or unqualified
>> version of void ."
>
> I do not know why you are addressing this to me. I agreed with
> the overall analysis and don't think I posted anything to the
> contrary.
>
> Perhaps you meant to respond to someone else?

This analysis is ultimately a response to the question "What
"dependency" would that avoid, other than a dependency on the C
standard?". As far as I can tell, you are the one who posted that
question, in the message with the header

Date: Sun, 9 Apr 2023 19:34:09 -0000 (UTC)

The simplest explanation of your confusion I can come up with is that
you misunderstood jak as suggesting that that dependency was in Tim's
code, rather than Kaz's.

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<u11c9m$27m86$3@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence
Kelly with Special Guest Borer Yekai Pan
Date: Mon, 10 Apr 2023 12:08:22 -0400
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <u11c9m$27m86$3@dont-email.me>
References: <u0fn0g$34scf$1@dont-email.me> <u0uk66$1or41$1@dont-email.me>
<u0v3vh$df3$1@reader2.panix.com> <u10erc$23rhg$1@dont-email.me>
<u117rb$9r2$2@reader2.panix.com> <u11aau$27go8$1@dont-email.me>
<Y8qq6QwnAovu5XLqP@bongo-ra.co>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 10 Apr 2023 16:08:22 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="585a2b92344e96b538cef7b9f0a43c30";
logging-data="2349318"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+UgpxoEGhGebwJOJYoBAIWBXCKEye+1hI="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.9.0
Cancel-Lock: sha1:ZajTD4O+3Rh+Gg70nf0k3z57FTA=
Content-Language: en-US
In-Reply-To: <Y8qq6QwnAovu5XLqP@bongo-ra.co>
 by: James Kuyper - Mon, 10 Apr 2023 16:08 UTC

On 4/10/23 11:58, Spiros Bousbouras wrote:
> On Mon, 10 Apr 2023 11:34:54 -0400
> James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
....
>> The comment about "implementation dependency" was written by Tim, jak
>> was merely referring to that comment.
>
> Yes , but which piece of code was jak referring to ? For easy reference lets
> call Code A
>
> return (size == 0) ? free(ptr), NULL : realloc(ptr, size);
>
> which posted by Kaz in <20230407042121.909@kylheku.com> and Code B
>
> void *
> realloc0( void *p, size_t size ){
> return size == 0 ? free( p ), p = 0 : realloc( p, size );
> }
>
> which was posted by Tim in <86r0st3zj0.fsf@linuxsc.com> .So when jak said
> "If you absolutely wanted to avoid dependency" which of the 2 code excerpts
> was he referring to ? I took it to mean that he was referring to Code B and I
> think Dan took it to mean the same. Code B does not have any "implementation
> dependency" , it just relies on the C standard. In contrast , Code A may have
> a constraint violation depending on how the implementation defines NULL , as
> Tim pointed out.

I took jak as referring to both code A and code B. He was saying that
code A has an implementation dependency, while code B did not, but that
he would prefer a different way of modifying code A to avoid that
dependency. I understood him to be expressing a stylistic preference,
not something required in order for the code to be correct.

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<u11ccu$27v2q$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: nos...@please.ty (jak)
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence
Kelly with Special Guest Borer Yekai Pan
Date: Mon, 10 Apr 2023 18:10:06 +0200
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <u11ccu$27v2q$1@dont-email.me>
References: <u0fn0g$34scf$1@dont-email.me> <u0uk66$1or41$1@dont-email.me>
<u0v3vh$df3$1@reader2.panix.com> <u10erc$23rhg$1@dont-email.me>
<u117rb$9r2$2@reader2.panix.com> <u11a0u$27j9d$1@dont-email.me>
<u11b4s$27go8$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 10 Apr 2023 16:10:06 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="324c3efb794bc08f3c95a3facab56a11";
logging-data="2358362"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX194kULNpO3DXecZdFnVZv06"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.16
Cancel-Lock: sha1:8R5roZ/+mkAmp1wqC1XVLE5cj8k=
In-Reply-To: <u11b4s$27go8$2@dont-email.me>
 by: jak - Mon, 10 Apr 2023 16:10 UTC

James Kuyper ha scritto:
> On 4/10/23 11:29, jak wrote:
> ...
>> char val;
>> int *pi;
>>
>> pi = (int *)&val;
>>
>> because if you assigned a value to *pi you would be using unallocated
>> memory
>
> The problem with that code has nothing to do with the problem Tim was
> talking about, nor does it have anything to do with unallocated memory.
> It has undefined behavior if &val points to a memory location that is
> not correctly aligned to hold an 'int' (6.3.2.3p7). More importantly,
> even if it is correctly aligned, the value stored in pi cannot be used
> to access an 'int', because it doesn't point at an int object.
>
>> ... and if you really want to do that you need a left cast:
>>
>> ((char *)pi) = &val;
>
> The left hand side of an assignment is required to be a modifiable
> lvalue (6.5.16p2). The result of a pointer conversion is not an lvalue.
>

hmmm... in my point of view declaring a variable corresponds to
allocating memory while using malloc means allocating memory
dynamically. For me it is not easy to express concepts in your language
and in addition you continue to take me back on the quibbles. Maybe we
can talk again when I improve my English and you're less picky.

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<u11cuh$281i6$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence
Kelly with Special Guest Borer Yekai Pan
Date: Mon, 10 Apr 2023 12:19:29 -0400
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <u11cuh$281i6$1@dont-email.me>
References: <u0fn0g$34scf$1@dont-email.me> <87zg7n89zw.fsf@bsb.me.uk>
<u0ig61$64g$1@reader2.panix.com> <874jpv84uv.fsf@bsb.me.uk>
<u0jt3l$cmu$1@reader2.panix.com> <u0k3au$3uelq$1@dont-email.me>
<u0lm3j$8iu$1@reader2.panix.com> <20230407042121.909@kylheku.com>
<86r0st3zj0.fsf@linuxsc.com> <u0uk66$1or41$1@dont-email.me>
<871qkshmhv.fsf@nosuchdomain.example.com> <u10dvr$23np8$1@dont-email.me>
<u11404$26gpq$1@dont-email.me> <u116gd$273m1$1@dont-email.me>
<u116uf$275ph$1@dont-email.me> <u119q9$27go7$3@dont-email.me>
<u11aqa$27na5$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 10 Apr 2023 16:19:29 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="585a2b92344e96b538cef7b9f0a43c30";
logging-data="2360902"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+6ayTKJNI+fEWFkzhQo/iM5f81XiQws40="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.9.0
Cancel-Lock: sha1:KJs+bC6BC5NIq+gEO3Is0K8QFKk=
Content-Language: en-US
In-Reply-To: <u11aqa$27na5$1@dont-email.me>
 by: James Kuyper - Mon, 10 Apr 2023 16:19 UTC

On 4/10/23 11:43, jak wrote:
> James Kuyper ha scritto:
>> On 4/10/23 10:37, jak wrote:
>> ...
>>>> Instead, explain to me why, after all the improvements introduced
>>>> by the
>>> standards, it is no longer possible to declare a specialized function
>>> pointer array without first declaring the typedef that defines the
>>> function pointer and why.
>>
>> "specialized function pointer array"? Are you posting that to the
>> correct newsgroup?
>> Even if this were comp.lang.c++, you've just swerved off into an
>> entirely different conversational direction - I would recommend starting
>> a new thread to discuss that issue.
>>
>
> Please tell me you're joking...

No, I'm dead serious. This is the wrong newsgroup to discuss specialized
functions, because C doesn't have them. There would be both more
interest, and more expertise, for a discussion of that issue in
comp.lang.c++ than here.
I'm also dead serious about the change in Subject. When you introduce a
radical change of topic, it is indeed good netiquette to make a
corresponding change to the "Subject:" header.

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<u11cvb$281i6$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence
Kelly with Special Guest Borer Yekai Pan
Date: Mon, 10 Apr 2023 12:19:55 -0400
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <u11cvb$281i6$2@dont-email.me>
References: <u0fn0g$34scf$1@dont-email.me> <u0uk66$1or41$1@dont-email.me>
<u0v3vh$df3$1@reader2.panix.com> <u10erc$23rhg$1@dont-email.me>
<u117rb$9r2$2@reader2.panix.com> <u11a0u$27j9d$1@dont-email.me>
<u11b4s$27go8$2@dont-email.me> <u11ccu$27v2q$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 10 Apr 2023 16:19:55 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="585a2b92344e96b538cef7b9f0a43c30";
logging-data="2360902"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+AXJdZR0VCsqv6iK3duFTBmlpdpXcg/L8="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.9.0
Cancel-Lock: sha1:npoUdhc1lt8Veoj+UFAtmxMwOp4=
Content-Language: en-US
In-Reply-To: <u11ccu$27v2q$1@dont-email.me>
 by: James Kuyper - Mon, 10 Apr 2023 16:19 UTC

On 4/10/23 12:10, jak wrote:
> James Kuyper ha scritto:
>> On 4/10/23 11:29, jak wrote:
>> ...
>>> char val;
>>> int *pi;
>>>
>>> pi = (int *)&val;
>>>
>>> because if you assigned a value to *pi you would be using unallocated
>>> memory
>>
>> The problem with that code has nothing to do with the problem Tim was
>> talking about, nor does it have anything to do with unallocated memory.
>> It has undefined behavior if &val points to a memory location that is
>> not correctly aligned to hold an 'int' (6.3.2.3p7). More importantly,
>> even if it is correctly aligned, the value stored in pi cannot be used
>> to access an 'int', because it doesn't point at an int object.
>>
>>> ... and if you really want to do that you need a left cast:
>>>
>>> ((char *)pi) = &val;
>>
>> The left hand side of an assignment is required to be a modifiable
>> lvalue (6.5.16p2). The result of a pointer conversion is not an lvalue.
>>
>
> hmmm... in my point of view declaring a variable corresponds to
> allocating memory while using malloc means allocating memory
> dynamically. For me it is not easy to express concepts in your language
> and in addition you continue to take me back on the quibbles. Maybe we
> can talk again when I improve my English and you're less picky.

Declaring 'val' allocates memory to store a char. Declaring pi allocates
memory to store a pointer to an int. (int*)val is an expression that
could have undefined behavior, for reasons that have nothing to do with
unallocated memory. If it doesn't have undefined behavior, the result of
that conversion can safely be stored in the memory allocated for pi. It
cannot, however, be used to access an int object, because it doesn't
point at any such object.

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<u11dt3$28648$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: nos...@please.ty (jak)
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence
Kelly with Special Guest Borer Yekai Pan
Date: Mon, 10 Apr 2023 18:35:47 +0200
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <u11dt3$28648$1@dont-email.me>
References: <u0fn0g$34scf$1@dont-email.me> <87zg7n89zw.fsf@bsb.me.uk>
<u0ig61$64g$1@reader2.panix.com> <874jpv84uv.fsf@bsb.me.uk>
<u0jt3l$cmu$1@reader2.panix.com> <u0k3au$3uelq$1@dont-email.me>
<u0lm3j$8iu$1@reader2.panix.com> <20230407042121.909@kylheku.com>
<86r0st3zj0.fsf@linuxsc.com> <u0uk66$1or41$1@dont-email.me>
<871qkshmhv.fsf@nosuchdomain.example.com> <u10dvr$23np8$1@dont-email.me>
<u11404$26gpq$1@dont-email.me> <u116gd$273m1$1@dont-email.me>
<u116uf$275ph$1@dont-email.me> <u119q9$27go7$3@dont-email.me>
<u11aqa$27na5$1@dont-email.me> <u11cuh$281i6$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 10 Apr 2023 16:35:47 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="324c3efb794bc08f3c95a3facab56a11";
logging-data="2365576"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/azNE6iWUwsFuqrBDgkZHd"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.16
Cancel-Lock: sha1:cdFdlIkzX5Fa8SEdsQ1/l2Yt2o8=
In-Reply-To: <u11cuh$281i6$1@dont-email.me>
 by: jak - Mon, 10 Apr 2023 16:35 UTC

James Kuyper ha scritto:
> On 4/10/23 11:43, jak wrote:
>> James Kuyper ha scritto:
>>> On 4/10/23 10:37, jak wrote:
>>> ...
>>>>> Instead, explain to me why, after all the improvements introduced
>>>>> by the
>>>> standards, it is no longer possible to declare a specialized function
>>>> pointer array without first declaring the typedef that defines the
>>>> function pointer and why.
>>>
>>> "specialized function pointer array"? Are you posting that to the
>>> correct newsgroup?
>>> Even if this were comp.lang.c++, you've just swerved off into an
>>> entirely different conversational direction - I would recommend starting
>>> a new thread to discuss that issue.
>>>
>>
>> Please tell me you're joking...
>
> No, I'm dead serious. This is the wrong newsgroup to discuss specialized
> functions, because C doesn't have them. There would be both more
> interest, and more expertise, for a discussion of that issue in
> comp.lang.c++ than here.
> I'm also dead serious about the change in Subject. When you introduce a
> radical change of topic, it is indeed good netiquette to make a
> corresponding change to the "Subject:" header.
>

What I can't explain to you is that you are fixated on terminology while
I'm trying to explain myself largely using the google translator. By
specialized function (this is the google translation) I mean a function
that has return values and parameters different from the inte type so
not like:

int foo(int)

You could, however, propose to the newsgroup manager that non-native
English speakers should not use it... or become less meticulous.

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<87ttxnheb6.fsf@nosuchdomain.example.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan
Date: Mon, 10 Apr 2023 09:50:21 -0700
Organization: None to speak of
Lines: 43
Message-ID: <87ttxnheb6.fsf@nosuchdomain.example.com>
References: <u0fn0g$34scf$1@dont-email.me> <87zg7n89zw.fsf@bsb.me.uk>
<u0ig61$64g$1@reader2.panix.com> <874jpv84uv.fsf@bsb.me.uk>
<u0jt3l$cmu$1@reader2.panix.com> <u0k3au$3uelq$1@dont-email.me>
<u0lm3j$8iu$1@reader2.panix.com> <20230407042121.909@kylheku.com>
<86r0st3zj0.fsf@linuxsc.com> <u0uk66$1or41$1@dont-email.me>
<871qkshmhv.fsf@nosuchdomain.example.com>
<u10dvr$23np8$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="d6e20649d7415fd7e1f46f27e74936ae";
logging-data="2369736"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+MBdOkbxeAGCQolFJpPowH"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:TtJ4Nc0gFU+xVdSeZ0+q+Z5cOUw=
sha1:xqbFhg5bRtApJUmSXVr2kVAq9bU=
 by: Keith Thompson - Mon, 10 Apr 2023 16:50 UTC

jak <nospam@please.ty> writes:
> Keith Thompson ha scritto:
>> jak <nospam@please.ty> writes:
>> [...]
>>> If you absolutely wanted to avoid dependency, perhaps you shouldn't rely
>>> on autocast and use an explicit one instead.
>> I've never seen the term "autocast" before.
>> A cast is an explicit conversion. A conversion done without a cast
>> is
>> an implicit conversion. "Autocast" would be a contradiction.
>
> Maybe this is because we don't come from the same county and therefore,
> probably, haven't read the same books? I don't formalize myself nor am I
> shocked when I read 'implicit conversion' despite the cast it should be
> considered a stretch and not a conversion. Perhaps you too should have a
> more open mind.

I don't know what you mean by "stretch". Can you explain?
Perhaps it has some technical meaning in books you've read, but I
haven't encountered it.

Having a "more open mind" doesn't help me to understand unfamiliar
terms that haven't been defined. "autocast", unlike "stretch",
is obvious enough in context, but in my opinion it's unnecessarily
obscure. When discussing C, I strongly prefer to use terms defined
by the C standard, with the meanings assigned by that standard.
I think that's the best way to establish a common vocabulary and
promote effective communication. I don't see that "autocast"
expresses anything that isn't more effectively expressed by
"implicit conversion".

As for the technical issue, I've found that implicit conversions are
often better (less error-prone, leading to more easily maintainable
code) than explicit casts. C probably has more implicit conversions
than I'm entirely comfortable with, but most of them do the right
thing most of the time. If you use a cast, you have the additional
burden of specifying the correct type, and keeping it correct as
the code is maintained.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for XCOM Labs
void Void(void) { Void(); } /* The recursive call of the void */

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<87pm8bhe3h.fsf@nosuchdomain.example.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan
Date: Mon, 10 Apr 2023 09:54:58 -0700
Organization: None to speak of
Lines: 23
Message-ID: <87pm8bhe3h.fsf@nosuchdomain.example.com>
References: <u0fn0g$34scf$1@dont-email.me> <87zg7n89zw.fsf@bsb.me.uk>
<u0ig61$64g$1@reader2.panix.com> <874jpv84uv.fsf@bsb.me.uk>
<u0jt3l$cmu$1@reader2.panix.com> <u0k3au$3uelq$1@dont-email.me>
<u0lm3j$8iu$1@reader2.panix.com> <20230407042121.909@kylheku.com>
<86r0st3zj0.fsf@linuxsc.com> <u0uk66$1or41$1@dont-email.me>
<871qkshmhv.fsf@nosuchdomain.example.com>
<u10dvr$23np8$1@dont-email.me> <u11404$26gpq$1@dont-email.me>
<u116gd$273m1$1@dont-email.me> <u116uf$275ph$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="d6e20649d7415fd7e1f46f27e74936ae";
logging-data="2369736"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+qnnvl00nhdpqKlhtuzMOH"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:By11TwcuusSwZdd41F1iFR29w6Y=
sha1:hbjx2lG7+H4dMSruHrrFd6YlXPY=
 by: Keith Thompson - Mon, 10 Apr 2023 16:54 UTC

jak <nospam@please.ty> writes:
>> Are you K.T's knight perhaps? Please stop quoting bits of manuals that
>> everyone has read hundreds of times, be less obtuse and learn to read
>> what is not written. Some field work wouldn't hurt. Do not hoe but claim
>> to design hoes.
>> Instead, explain to me why, after all the improvements introduced by the
> standards, it is no longer possible to declare a specialized function
> pointer array without first declaring the typedef that defines the
> function pointer and why.

I'm not aware that that's true. If it is, I invite you to start a new
thread to discuss it. I don't know what you mean by "specialized" in
this context, and I'm not aware of any case where declaring an array of
function pointers requires a typedef.

This thread has already drifted, as many threads do, so it might not
matter a great deal whether you start a new thread or not, but it is a
substantial change of topic.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for XCOM Labs
void Void(void) { Void(); } /* The recursive call of the void */

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<e5916e17-dbdc-4c81-a307-a16be989b3cen@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:410e:b0:746:7fbd:e22f with SMTP id j14-20020a05620a410e00b007467fbde22fmr2636900qko.12.1681145752647;
Mon, 10 Apr 2023 09:55:52 -0700 (PDT)
X-Received: by 2002:a05:622a:1ba8:b0:3e3:8587:21f8 with SMTP id
bp40-20020a05622a1ba800b003e3858721f8mr4041480qtb.8.1681145752406; Mon, 10
Apr 2023 09:55:52 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Mon, 10 Apr 2023 09:55:52 -0700 (PDT)
In-Reply-To: <u11ccu$27v2q$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23a8:400a:5601:2841:621:b82:4c9b;
posting-account=Dz2zqgkAAADlK5MFu78bw3ab-BRFV4Qn
NNTP-Posting-Host: 2a00:23a8:400a:5601:2841:621:b82:4c9b
References: <u0fn0g$34scf$1@dont-email.me> <u0uk66$1or41$1@dont-email.me>
<u0v3vh$df3$1@reader2.panix.com> <u10erc$23rhg$1@dont-email.me>
<u117rb$9r2$2@reader2.panix.com> <u11a0u$27j9d$1@dont-email.me>
<u11b4s$27go8$2@dont-email.me> <u11ccu$27v2q$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e5916e17-dbdc-4c81-a307-a16be989b3cen@googlegroups.com>
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence
Kelly with Special Guest Borer Yekai Pan
From: malcolm....@gmail.com (Malcolm McLean)
Injection-Date: Mon, 10 Apr 2023 16:55:52 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3179
 by: Malcolm McLean - Mon, 10 Apr 2023 16:55 UTC

On Monday, 10 April 2023 at 17:10:19 UTC+1, jak wrote:
> James Kuyper ha scritto:
> > On 4/10/23 11:29, jak wrote:
> > ...
> >> char val;
> >> int *pi;
> >>
> >> pi = (int *)&val;
> >>
> >> because if you assigned a value to *pi you would be using unallocated
> >> memory
> >
> > The problem with that code has nothing to do with the problem Tim was
> > talking about, nor does it have anything to do with unallocated memory.
> > It has undefined behavior if &val points to a memory location that is
> > not correctly aligned to hold an 'int' (6.3.2.3p7). More importantly,
> > even if it is correctly aligned, the value stored in pi cannot be used
> > to access an 'int', because it doesn't point at an int object.
> >
> >> ... and if you really want to do that you need a left cast:
> >>
> >> ((char *)pi) = &val;
> >
> > The left hand side of an assignment is required to be a modifiable
> > lvalue (6.5.16p2). The result of a pointer conversion is not an lvalue.
> >
> hmmm... in my point of view declaring a variable corresponds to
> allocating memory while using malloc means allocating memory
> dynamically. For me it is not easy to express concepts in your language
> and in addition you continue to take me back on the quibbles. Maybe we
> can talk again when I improve my English and you're less picky.
>
In a sense that is right. But generally the term "allocating" isn't used for
variables created on the stack, unless maybe for large arrays.
The reason is that the stack works by magic. Within the confines of the
C language, there is no way to express that the stack might fail, though
of course it must do so eventually if allowed to get arbitrarily deep.

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<87leizhdy6.fsf@nosuchdomain.example.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan
Date: Mon, 10 Apr 2023 09:58:09 -0700
Organization: None to speak of
Lines: 27
Message-ID: <87leizhdy6.fsf@nosuchdomain.example.com>
References: <u0fn0g$34scf$1@dont-email.me> <87zg7n89zw.fsf@bsb.me.uk>
<u0ig61$64g$1@reader2.panix.com> <874jpv84uv.fsf@bsb.me.uk>
<u0jt3l$cmu$1@reader2.panix.com> <u0k3au$3uelq$1@dont-email.me>
<u0lm3j$8iu$1@reader2.panix.com> <20230407042121.909@kylheku.com>
<86r0st3zj0.fsf@linuxsc.com> <u0uk66$1or41$1@dont-email.me>
<871qkshmhv.fsf@nosuchdomain.example.com>
<u10dvr$23np8$1@dont-email.me> <u11404$26gpq$1@dont-email.me>
<u116gd$273m1$1@dont-email.me> <u116uf$275ph$1@dont-email.me>
<u119q9$27go7$3@dont-email.me> <u11aqa$27na5$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="d6e20649d7415fd7e1f46f27e74936ae";
logging-data="2369736"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+X+SXn2OozpcDQTaegO9xF"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:SsGaxLcI9a2vyWBmnSTzMCdnwrM=
sha1:mpHLBuR0QDqLP1AELwHXQr4uQyo=
 by: Keith Thompson - Mon, 10 Apr 2023 16:58 UTC

jak <nospam@please.ty> writes:
> James Kuyper ha scritto:
>> On 4/10/23 10:37, jak wrote:
>> ...
>>>> Instead, explain to me why, after all the improvements introduced by the
>>> standards, it is no longer possible to declare a specialized function
>>> pointer array without first declaring the typedef that defines the
>>> function pointer and why.
>> "specialized function pointer array"? Are you posting that to the
>> correct newsgroup?
>> Even if this were comp.lang.c++, you've just swerved off into an
>> entirely different conversational direction - I would recommend starting
>> a new thread to discuss that issue.
>
> Please tell me you're joking...

James and I do not speak for each other, but I see no reason to think he
was joking, and I agree with what he wrote. I'm not assuming that you
were making a point about C++, but the word "specialized" does suggest
that it's likely; if so, I suggest posting in comp.lang.c++.

If you perceive a joke, perhaps you can explain it to us.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for XCOM Labs
void Void(void) { Void(); } /* The recursive call of the void */

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<681e3cb9-65b6-472b-b710-4e492154f238n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:29c6:b0:746:9ff2:27f with SMTP id s6-20020a05620a29c600b007469ff2027fmr2646841qkp.8.1681146165270;
Mon, 10 Apr 2023 10:02:45 -0700 (PDT)
X-Received: by 2002:ac8:59cf:0:b0:3bf:e265:9bf with SMTP id
f15-20020ac859cf000000b003bfe26509bfmr4202689qtf.5.1681146165034; Mon, 10 Apr
2023 10:02:45 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Mon, 10 Apr 2023 10:02:44 -0700 (PDT)
In-Reply-To: <u11dt3$28648$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=84.50.190.130; posting-account=pysjKgkAAACLegAdYDFznkqjgx_7vlUK
NNTP-Posting-Host: 84.50.190.130
References: <u0fn0g$34scf$1@dont-email.me> <87zg7n89zw.fsf@bsb.me.uk>
<u0ig61$64g$1@reader2.panix.com> <874jpv84uv.fsf@bsb.me.uk>
<u0jt3l$cmu$1@reader2.panix.com> <u0k3au$3uelq$1@dont-email.me>
<u0lm3j$8iu$1@reader2.panix.com> <20230407042121.909@kylheku.com>
<86r0st3zj0.fsf@linuxsc.com> <u0uk66$1or41$1@dont-email.me>
<871qkshmhv.fsf@nosuchdomain.example.com> <u10dvr$23np8$1@dont-email.me>
<u11404$26gpq$1@dont-email.me> <u116gd$273m1$1@dont-email.me>
<u116uf$275ph$1@dont-email.me> <u119q9$27go7$3@dont-email.me>
<u11aqa$27na5$1@dont-email.me> <u11cuh$281i6$1@dont-email.me> <u11dt3$28648$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <681e3cb9-65b6-472b-b710-4e492154f238n@googlegroups.com>
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence
Kelly with Special Guest Borer Yekai Pan
From: oot...@hot.ee (Öö Tiib)
Injection-Date: Mon, 10 Apr 2023 17:02:45 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 52
 by: Öö Tiib - Mon, 10 Apr 2023 17:02 UTC

On Monday, 10 April 2023 at 19:36:00 UTC+3, jak wrote:
> James Kuyper ha scritto:
> > On 4/10/23 11:43, jak wrote:
> >> James Kuyper ha scritto:
> >>> On 4/10/23 10:37, jak wrote:
> >>> ...
> >>>>> Instead, explain to me why, after all the improvements introduced
> >>>>> by the
> >>>> standards, it is no longer possible to declare a specialized function
> >>>> pointer array without first declaring the typedef that defines the
> >>>> function pointer and why.
> >>>
> >>> "specialized function pointer array"? Are you posting that to the
> >>> correct newsgroup?
> >>> Even if this were comp.lang.c++, you've just swerved off into an
> >>> entirely different conversational direction - I would recommend starting
> >>> a new thread to discuss that issue.
> >>>
> >>
> >> Please tell me you're joking...
> >
> > No, I'm dead serious. This is the wrong newsgroup to discuss specialized
> > functions, because C doesn't have them. There would be both more
> > interest, and more expertise, for a discussion of that issue in
> > comp.lang.c++ than here.
> > I'm also dead serious about the change in Subject. When you introduce a
> > radical change of topic, it is indeed good netiquette to make a
> > corresponding change to the "Subject:" header.
> >
>
> What I can't explain to you is that you are fixated on terminology while
> I'm trying to explain myself largely using the google translator. By
> specialized function (this is the google translation) I mean a function
> that has return values and parameters different from the inte type so
> not like:
>
> int foo(int)
>
That indeed is change of subject, what you post is not array, and it is
still unclear what you want. We can define variable of type of array of
function pointers without any typedefs like that:

double (*array_of_function_pointers[52]) (float f, char c);

That AFAIK works both in C and in C++.

> You could, however, propose to the newsgroup manager that non-native
> English speakers should not use it... or become less meticulous.

What newsreader it is that does not let you to start a new thread
or to change the subject line when you want to change subject?
Never seen such thing.

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<u11fu6$28f9a$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence
Kelly with Special Guest Borer Yekai Pan
Date: Mon, 10 Apr 2023 13:10:30 -0400
Organization: A noiseless patient Spider
Lines: 65
Message-ID: <u11fu6$28f9a$1@dont-email.me>
References: <u0fn0g$34scf$1@dont-email.me> <87zg7n89zw.fsf@bsb.me.uk>
<u0ig61$64g$1@reader2.panix.com> <874jpv84uv.fsf@bsb.me.uk>
<u0jt3l$cmu$1@reader2.panix.com> <u0k3au$3uelq$1@dont-email.me>
<u0lm3j$8iu$1@reader2.panix.com> <20230407042121.909@kylheku.com>
<86r0st3zj0.fsf@linuxsc.com> <u0uk66$1or41$1@dont-email.me>
<871qkshmhv.fsf@nosuchdomain.example.com> <u10dvr$23np8$1@dont-email.me>
<u11404$26gpq$1@dont-email.me> <u116gd$273m1$1@dont-email.me>
<u116uf$275ph$1@dont-email.me> <u119q9$27go7$3@dont-email.me>
<u11aqa$27na5$1@dont-email.me> <u11cuh$281i6$1@dont-email.me>
<u11dt3$28648$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 10 Apr 2023 17:10:30 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="585a2b92344e96b538cef7b9f0a43c30";
logging-data="2374954"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+0req3v4F6Ix91Fz6m5fVWLVga1+rixE0="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.9.0
Cancel-Lock: sha1:4Ezj9BnlFjO1XcittiVnp9I0Yn0=
Content-Language: en-US
In-Reply-To: <u11dt3$28648$1@dont-email.me>
 by: James Kuyper - Mon, 10 Apr 2023 17:10 UTC

On 4/10/23 12:35, jak wrote:
> James Kuyper ha scritto:
>> On 4/10/23 11:43, jak wrote:
>>> James Kuyper ha scritto:
>>>> On 4/10/23 10:37, jak wrote:
>>>> ...
>>>>>> Instead, explain to me why, after all the improvements introduced
>>>>>> by the
>>>>> standards, it is no longer possible to declare a specialized function
>>>>> pointer array without first declaring the typedef that defines the
>>>>> function pointer and why.
>>>>
>>>> "specialized function pointer array"? Are you posting that to the
>>>> correct newsgroup?
>>>> Even if this were comp.lang.c++, you've just swerved off into an
>>>> entirely different conversational direction - I would recommend
>>>> starting
>>>> a new thread to discuss that issue.
>>>>
>>>
>>> Please tell me you're joking...
>>
>> No, I'm dead serious. This is the wrong newsgroup to discuss specialized
>> functions, because C doesn't have them. There would be both more
>> interest, and more expertise, for a discussion of that issue in
>> comp.lang.c++ than here.
....
> What I can't explain to you is that you are fixated on terminology while
> I'm trying to explain myself largely using the google translator. By
> specialized function (this is the google translation) I mean a function
> that has return values and parameters different from the inte type so
> not like:
>
> int foo(int)
>
> You could, however, propose to the newsgroup manager that non-native
> English speakers should not use it... or become less meticulous.

Google translate does not do a good enough job of translating your
language into English, to allow discussion of such complicated issues.
If there's any forum using a language that you understand well enough, I
recommend using it.

I would never have considered the possibility that someone would use to
term "specialized function" to refer to such a thing. I still don't
understand the problem that you're complaining about. You can declare an
array of pointers to unspecialized functions as follows:

int unspec(int);
int (*unspec_array1[15])(int)={unspec};

An array of pointers to any particular specialized function type can be
declared equally easily:

char spec(double);
char (*spec_array1[15])(double)={spec};

I think you've left out some important details about what it is you want
to do, that prevents it from being done without a typedef.
Perhaps you're thinking of a heterogeneous array, one that contains
pointers to functions with two or more different types? The array itself
can have only one type, and using such an array often requires
conversion of a function pointer type to that type. A typedef makes that
much simpler, but is not necessary.

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<u11g0i$28g0k$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: nos...@please.ty (jak)
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence
Kelly with Special Guest Borer Yekai Pan
Date: Mon, 10 Apr 2023 19:11:46 +0200
Organization: A noiseless patient Spider
Lines: 58
Message-ID: <u11g0i$28g0k$1@dont-email.me>
References: <u0fn0g$34scf$1@dont-email.me> <87zg7n89zw.fsf@bsb.me.uk>
<u0ig61$64g$1@reader2.panix.com> <874jpv84uv.fsf@bsb.me.uk>
<u0jt3l$cmu$1@reader2.panix.com> <u0k3au$3uelq$1@dont-email.me>
<u0lm3j$8iu$1@reader2.panix.com> <20230407042121.909@kylheku.com>
<86r0st3zj0.fsf@linuxsc.com> <u0uk66$1or41$1@dont-email.me>
<871qkshmhv.fsf@nosuchdomain.example.com> <u10dvr$23np8$1@dont-email.me>
<u11404$26gpq$1@dont-email.me> <u116gd$273m1$1@dont-email.me>
<u116uf$275ph$1@dont-email.me> <u119q9$27go7$3@dont-email.me>
<u11aqa$27na5$1@dont-email.me> <u11cuh$281i6$1@dont-email.me>
<u11dt3$28648$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 10 Apr 2023 17:11:46 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f66baeed5b014a07f92ea570ae3ab4e9";
logging-data="2375700"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186gd2BhB0M3XYYxVxIlNyI"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.16
Cancel-Lock: sha1:fv0Li9lGlePdHXe1fuH9Es1OKDA=
In-Reply-To: <u11dt3$28648$1@dont-email.me>
 by: jak - Mon, 10 Apr 2023 17:11 UTC

jak ha scritto:
> James Kuyper ha scritto:
>> On 4/10/23 11:43, jak wrote:
>>> James Kuyper ha scritto:
>>>> On 4/10/23 10:37, jak wrote:
>>>> ...
>>>>>> Instead, explain to me why, after all the improvements introduced
>>>>>> by the
>>>>> standards, it is no longer possible to declare a specialized function
>>>>> pointer array without first declaring the typedef that defines the
>>>>> function pointer and why.
>>>>
>>>> "specialized function pointer array"? Are you posting that to the
>>>> correct newsgroup?
>>>> Even if this were comp.lang.c++, you've just swerved off into an
>>>> entirely different conversational direction - I would recommend
>>>> starting
>>>> a new thread to discuss that issue.
>>>>
>>>
>>> Please tell me you're joking...
>>
>> No, I'm dead serious. This is the wrong newsgroup to discuss specialized
>> functions, because C doesn't have them. There would be both more
>> interest, and more expertise, for a discussion of that issue in
>> comp.lang.c++ than here.
>> I'm also dead serious about the change in Subject. When you introduce a
>> radical change of topic, it is indeed good netiquette to make a
>> corresponding change to the "Subject:" header.
>>
>
> What I can't explain to you is that you are fixated on terminology while
> I'm trying to explain myself largely using the google translator. By
> specialized function (this is the google translation) I mean a function
> that has return values and parameters different from the inte type so
> not like:
>
> int foo(int)
>
> You could, however, propose to the newsgroup manager that non-native
> English speakers should not use it... or become less meticulous.

Also I would like to add that the concept of 'standard' that you follow
with religious attention, IMO, is wrong because up to now it has not
evolved but it has changed and this is insane. 'Standard' is a luxury
for programming theorists. Thousands of companies use decades-old
compilers so they don't have to change millions of lines of currently
working code. The 'standard' should be followed by compiler makers and
not compiler users. In the discussion of this thread we discuss a
ternary operator which returns 0 in one rung and a pointer in the other.
The standard says that 0 can be raised to a null pointer and it is true
but tomorrow someone will change the 'standard' and this will no longer
be true. Portability should also be considered over time and making sure
both branches of the ternary operator return a pointer by adding a cast
even if it's now unnecessary is not a bad thing because it could make
the function *also* portable over time. Those who have coded for decades
have seen these things and know they will happen again.

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<rBXYL.1140524$t5W7.570138@fx13.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!peer03.ams4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx13.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan
Newsgroups: comp.lang.c
References: <u0fn0g$34scf$1@dont-email.me> <u0lm3j$8iu$1@reader2.panix.com> <20230407042121.909@kylheku.com> <86r0st3zj0.fsf@linuxsc.com> <u0uk66$1or41$1@dont-email.me> <871qkshmhv.fsf@nosuchdomain.example.com> <u10dvr$23np8$1@dont-email.me> <u11404$26gpq$1@dont-email.me> <u116gd$273m1$1@dont-email.me> <u116uf$275ph$1@dont-email.me> <u119q9$27go7$3@dont-email.me> <u11aqa$27na5$1@dont-email.me> <u11cuh$281i6$1@dont-email.me> <u11dt3$28648$1@dont-email.me> <u11g0i$28g0k$1@dont-email.me>
Lines: 56
Message-ID: <rBXYL.1140524$t5W7.570138@fx13.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Mon, 10 Apr 2023 17:22:31 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Mon, 10 Apr 2023 17:22:31 GMT
X-Received-Bytes: 3770
 by: Scott Lurndal - Mon, 10 Apr 2023 17:22 UTC

jak <nospam@please.ty> writes:
>jak ha scritto:
>> James Kuyper ha scritto:
>>> On 4/10/23 11:43, jak wrote:
>>>> James Kuyper ha scritto:
>>>>> On 4/10/23 10:37, jak wrote:
>>>>> ...
>>>>>>> Instead, explain to me why, after all the improvements introduced
>>>>>>> by the
>>>>>> standards, it is no longer possible to declare a specialized function
>>>>>> pointer array without first declaring the typedef that defines the
>>>>>> function pointer and why.
>>>>>
>>>>> "specialized function pointer array"? Are you posting that to the
>>>>> correct newsgroup?
>>>>> Even if this were comp.lang.c++, you've just swerved off into an
>>>>> entirely different conversational direction - I would recommend
>>>>> starting
>>>>> a new thread to discuss that issue.
>>>>>
>>>>
>>>> Please tell me you're joking...
>>>
>>> No, I'm dead serious. This is the wrong newsgroup to discuss specialized
>>> functions, because C doesn't have them. There would be both more
>>> interest, and more expertise, for a discussion of that issue in
>>> comp.lang.c++ than here.
>>> I'm also dead serious about the change in Subject. When you introduce a
>>> radical change of topic, it is indeed good netiquette to make a
>>> corresponding change to the "Subject:" header.
>>>
>>
>> What I can't explain to you is that you are fixated on terminology while
>> I'm trying to explain myself largely using the google translator. By
>> specialized function (this is the google translation) I mean a function
>> that has return values and parameters different from the inte type so
>> not like:
>>
>> int foo(int)
>>
>> You could, however, propose to the newsgroup manager that non-native
>> English speakers should not use it... or become less meticulous.
>
>Also I would like to add that the concept of 'standard' that you follow
>with religious attention, IMO, is wrong because up to now it has not
>evolved but it has changed and this is insane. 'Standard' is a luxury
>for programming theorists. Thousands of companies use decades-old
>compilers so they don't have to change millions of lines of currently
>working code. The 'standard' should be followed by compiler makers and
>not compiler users. In the discussion of this thread we discuss a
>ternary operator which returns 0 in one rung and a pointer in the other.
>The standard says that 0 can be raised to a null pointer and it is true

Well, I've worked with systems where a null pointer was represented by
the 32-bit value 0xc0eeeeee. So you can't make assumptions, just use
NULL (or nullptr in C++).

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<u11grn$q26$1@reader2.panix.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail
From: cro...@spitfire.i.gajendra.net (Dan Cross)
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence
Kelly with Special Guest Borer Yekai Pan
Date: Mon, 10 Apr 2023 17:26:15 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <u11grn$q26$1@reader2.panix.com>
References: <u0fn0g$34scf$1@dont-email.me> <u11aau$27go8$1@dont-email.me> <u11afa$1jl$2@reader2.panix.com> <u11bll$27m86$1@dont-email.me>
Injection-Date: Mon, 10 Apr 2023 17:26:15 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80";
logging-data="26694"; mail-complaints-to="abuse@panix.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: cross@spitfire.i.gajendra.net (Dan Cross)
 by: Dan Cross - Mon, 10 Apr 2023 17:26 UTC

In article <u11bll$27m86$1@dont-email.me>,
James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
>On 4/10/23 11:37, Dan Cross wrote:
>>[snip]
>> It seemed that jak was suggesting that in Tim's forumulation,
>> one should cast the 0 in p = 0, as in `p = (void *)0`.
>
>I don't think so. I believe that he was suggesting that it would be
>preferable to rewrite Kaz's formulation as "free(ptr), (void*)NULL", or
>simply "free(ptr), (void*)0", which would avoid the implementation
>dependency. I took this as a suggestion of style, rather than implying
>that it was necessary. The fact that "p=0" implicitly converts 0 to 'p's
>type, and is the value of the assignment expression, is a little too
>subtle for Jak, and I can see his point.

You (and honestly, me) are both speculating. This is why I
asked him what he meant; he responded by asking me why I was
asking him. Subsequent posts from me suggest a less than
stellar command of the language, so I suspect he's simply
confused.

>>>> This has nothing to do with that. Tim's code was correct and
>>>> portable.
>>>
>>> Tim's comment about an implementation dependency was written about code
>>> written by Kaz Kylheku. That code does indeed have an implementation
>>> dependency. Depending upon which choice an implementation makes for the
>>> null pointer constant that NULL expands into, Kaz's code might or might
>>> not contain a constraint violation.
>>
>> That was not what I was referring to; see above and please note
>> the exact words I responded to (specifically the post that
>> referred to "autocast").
>
>Jak's comment using the phrase "autocast" was not referring to any
>implementation dependency in Tim's code, only to the same implementation
>dependency in Kaz's code that Tim himself was talking about.

Why don't we let him speak for himself?

- Dan C.

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<u11gui$q26$2@reader2.panix.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail
From: cro...@spitfire.i.gajendra.net (Dan Cross)
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence
Kelly with Special Guest Borer Yekai Pan
Date: Mon, 10 Apr 2023 17:27:46 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <u11gui$q26$2@reader2.panix.com>
References: <u0fn0g$34scf$1@dont-email.me> <u11aau$27go8$1@dont-email.me> <Y8qq6QwnAovu5XLqP@bongo-ra.co> <u11c9m$27m86$3@dont-email.me>
Injection-Date: Mon, 10 Apr 2023 17:27:46 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80";
logging-data="26694"; mail-complaints-to="abuse@panix.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: cross@spitfire.i.gajendra.net (Dan Cross)
 by: Dan Cross - Mon, 10 Apr 2023 17:27 UTC

In article <u11c9m$27m86$3@dont-email.me>,
James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
>On 4/10/23 11:58, Spiros Bousbouras wrote:
>> On Mon, 10 Apr 2023 11:34:54 -0400
>> James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
>...
>>> The comment about "implementation dependency" was written by Tim, jak
>>> was merely referring to that comment.
>>
>> Yes , but which piece of code was jak referring to ? For easy reference lets
>> call Code A
>>
>> return (size == 0) ? free(ptr), NULL : realloc(ptr, size);
>>
>> which posted by Kaz in <20230407042121.909@kylheku.com> and Code B
>>
>> void *
>> realloc0( void *p, size_t size ){
>> return size == 0 ? free( p ), p = 0 : realloc( p, size );
>> }
>>
>> which was posted by Tim in <86r0st3zj0.fsf@linuxsc.com> .So when jak said
>> "If you absolutely wanted to avoid dependency" which of the 2 code excerpts
>> was he referring to ? I took it to mean that he was referring to Code B and I
>> think Dan took it to mean the same. Code B does not have any "implementation
>> dependency" , it just relies on the C standard. In contrast , Code A may have
>> a constraint violation depending on how the implementation defines NULL , as
>> Tim pointed out.
>
>I took jak as referring to both code A and code B. He was saying that
>code A has an implementation dependency, while code B did not, but that
>he would prefer a different way of modifying code A to avoid that
>dependency. I understood him to be expressing a stylistic preference,
>not something required in order for the code to be correct.

Instead of assuming, you should simply ask him.

- Dan C.

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<u11h8h$28kf8$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: nos...@please.ty (jak)
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence
Kelly with Special Guest Borer Yekai Pan
Date: Mon, 10 Apr 2023 19:33:06 +0200
Organization: A noiseless patient Spider
Lines: 60
Message-ID: <u11h8h$28kf8$1@dont-email.me>
References: <u0fn0g$34scf$1@dont-email.me> <u0lm3j$8iu$1@reader2.panix.com>
<20230407042121.909@kylheku.com> <86r0st3zj0.fsf@linuxsc.com>
<u0uk66$1or41$1@dont-email.me> <871qkshmhv.fsf@nosuchdomain.example.com>
<u10dvr$23np8$1@dont-email.me> <u11404$26gpq$1@dont-email.me>
<u116gd$273m1$1@dont-email.me> <u116uf$275ph$1@dont-email.me>
<u119q9$27go7$3@dont-email.me> <u11aqa$27na5$1@dont-email.me>
<u11cuh$281i6$1@dont-email.me> <u11dt3$28648$1@dont-email.me>
<u11g0i$28g0k$1@dont-email.me> <rBXYL.1140524$t5W7.570138@fx13.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 10 Apr 2023 17:33:05 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f66baeed5b014a07f92ea570ae3ab4e9";
logging-data="2380264"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18zuFJ3aij2855nvJSdRUu2"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.16
Cancel-Lock: sha1:YWXI53AmriFyVII6XhCEUd4aQMA=
In-Reply-To: <rBXYL.1140524$t5W7.570138@fx13.iad>
 by: jak - Mon, 10 Apr 2023 17:33 UTC

Scott Lurndal ha scritto:
> jak <nospam@please.ty> writes:
>> jak ha scritto:
>>> James Kuyper ha scritto:
>>>> On 4/10/23 11:43, jak wrote:
>>>>> James Kuyper ha scritto:
>>>>>> On 4/10/23 10:37, jak wrote:
>>>>>> ...
>>>>>>>> Instead, explain to me why, after all the improvements introduced
>>>>>>>> by the
>>>>>>> standards, it is no longer possible to declare a specialized function
>>>>>>> pointer array without first declaring the typedef that defines the
>>>>>>> function pointer and why.
>>>>>>
>>>>>> "specialized function pointer array"? Are you posting that to the
>>>>>> correct newsgroup?
>>>>>> Even if this were comp.lang.c++, you've just swerved off into an
>>>>>> entirely different conversational direction - I would recommend
>>>>>> starting
>>>>>> a new thread to discuss that issue.
>>>>>>
>>>>>
>>>>> Please tell me you're joking...
>>>>
>>>> No, I'm dead serious. This is the wrong newsgroup to discuss specialized
>>>> functions, because C doesn't have them. There would be both more
>>>> interest, and more expertise, for a discussion of that issue in
>>>> comp.lang.c++ than here.
>>>> I'm also dead serious about the change in Subject. When you introduce a
>>>> radical change of topic, it is indeed good netiquette to make a
>>>> corresponding change to the "Subject:" header.
>>>>
>>>
>>> What I can't explain to you is that you are fixated on terminology while
>>> I'm trying to explain myself largely using the google translator. By
>>> specialized function (this is the google translation) I mean a function
>>> that has return values and parameters different from the inte type so
>>> not like:
>>>
>>> int foo(int)
>>>
>>> You could, however, propose to the newsgroup manager that non-native
>>> English speakers should not use it... or become less meticulous.
>>
>> Also I would like to add that the concept of 'standard' that you follow
>> with religious attention, IMO, is wrong because up to now it has not
>> evolved but it has changed and this is insane. 'Standard' is a luxury
>> for programming theorists. Thousands of companies use decades-old
>> compilers so they don't have to change millions of lines of currently
>> working code. The 'standard' should be followed by compiler makers and
>> not compiler users. In the discussion of this thread we discuss a
>> ternary operator which returns 0 in one rung and a pointer in the other.
>> The standard says that 0 can be raised to a null pointer and it is true
>
> Well, I've worked with systems where a null pointer was represented by
> the 32-bit value 0xc0eeeeee. So you can't make assumptions, just use
> NULL (or nullptr in C++).
>
hmm...so we agree, right?

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<u11hbv$q26$3@reader2.panix.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail
From: cro...@spitfire.i.gajendra.net (Dan Cross)
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence
Kelly with Special Guest Borer Yekai Pan
Date: Mon, 10 Apr 2023 17:34:55 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <u11hbv$q26$3@reader2.panix.com>
References: <u0fn0g$34scf$1@dont-email.me> <u119gi$27go7$1@dont-email.me> <u11aba$1jl$1@reader2.panix.com> <u11c1o$27m86$2@dont-email.me>
Injection-Date: Mon, 10 Apr 2023 17:34:55 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80";
logging-data="26694"; mail-complaints-to="abuse@panix.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: cross@spitfire.i.gajendra.net (Dan Cross)
 by: Dan Cross - Mon, 10 Apr 2023 17:34 UTC

In article <u11c1o$27m86$2@dont-email.me>,
James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
>On 4/10/23 11:35, Dan Cross wrote:
>>[snip]
>> I do not know why you are addressing this to me. I agreed with
>> the overall analysis and don't think I posted anything to the
>> contrary.
>>
>> Perhaps you meant to respond to someone else?
>
>This analysis is ultimately a response to the question "What
>"dependency" would that avoid, other than a dependency on the C
>standard?". As far as I can tell, you are the one who posted that
>question, in the message with the header
>
>Date: Sun, 9 Apr 2023 19:34:09 -0000 (UTC)
>
>The simplest explanation of your confusion I can come up with is that
>you misunderstood jak as suggesting that that dependency was in Tim's
>code, rather than Kaz's.

First, please stop emailing me about this. Keep it in USENET.

Second, you are making an assumption about user jak's intent.
Respectfully, I think your assumption is wrong, which leads to
your (ahem) "confusion." Perhaps try to clarify with jak what
they mean before continuing the conversation; I tried and was
rebuffed, but perhaps you will have better luck.

- Dan C.

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<u11hp4$28nup$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: nos...@please.ty (jak)
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence
Kelly with Special Guest Borer Yekai Pan
Date: Mon, 10 Apr 2023 19:41:56 +0200
Organization: A noiseless patient Spider
Lines: 72
Message-ID: <u11hp4$28nup$1@dont-email.me>
References: <u0fn0g$34scf$1@dont-email.me> <u0lm3j$8iu$1@reader2.panix.com>
<20230407042121.909@kylheku.com> <86r0st3zj0.fsf@linuxsc.com>
<u0uk66$1or41$1@dont-email.me> <871qkshmhv.fsf@nosuchdomain.example.com>
<u10dvr$23np8$1@dont-email.me> <u11404$26gpq$1@dont-email.me>
<u116gd$273m1$1@dont-email.me> <u116uf$275ph$1@dont-email.me>
<u119q9$27go7$3@dont-email.me> <u11aqa$27na5$1@dont-email.me>
<u11cuh$281i6$1@dont-email.me> <u11dt3$28648$1@dont-email.me>
<u11g0i$28g0k$1@dont-email.me> <rBXYL.1140524$t5W7.570138@fx13.iad>
<u11h8h$28kf8$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 10 Apr 2023 17:41:56 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f66baeed5b014a07f92ea570ae3ab4e9";
logging-data="2383833"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+fV8TJV9rud1giR3tq7AuG"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.16
Cancel-Lock: sha1:J6rXGuM4YJlWP4qL+fETmvH2Dj0=
In-Reply-To: <u11h8h$28kf8$1@dont-email.me>
 by: jak - Mon, 10 Apr 2023 17:41 UTC

jak ha scritto:
> Scott Lurndal ha scritto:
>> jak <nospam@please.ty> writes:
>>> jak ha scritto:
>>>> James Kuyper ha scritto:
>>>>> On 4/10/23 11:43, jak wrote:
>>>>>> James Kuyper ha scritto:
>>>>>>> On 4/10/23 10:37, jak wrote:
>>>>>>> ...
>>>>>>>>> Instead, explain to me why, after all the improvements introduced
>>>>>>>>> by the
>>>>>>>> standards, it is no longer possible to declare a specialized
>>>>>>>> function
>>>>>>>> pointer array without first declaring the typedef that defines the
>>>>>>>> function pointer and why.
>>>>>>>
>>>>>>> "specialized function pointer array"? Are you posting that to the
>>>>>>> correct newsgroup?
>>>>>>> Even if this were comp.lang.c++, you've just swerved off into an
>>>>>>> entirely different conversational direction - I would recommend
>>>>>>> starting
>>>>>>> a new thread to discuss that issue.
>>>>>>>
>>>>>>
>>>>>> Please tell me you're joking...
>>>>>
>>>>> No, I'm dead serious. This is the wrong newsgroup to discuss
>>>>> specialized
>>>>> functions, because C doesn't have them. There would be both more
>>>>> interest, and more expertise, for a discussion of that issue in
>>>>> comp.lang.c++ than here.
>>>>> I'm also dead serious about the change in Subject. When you
>>>>> introduce a
>>>>> radical change of topic, it is indeed good netiquette to make a
>>>>> corresponding change to the "Subject:" header.
>>>>>
>>>>
>>>> What I can't explain to you is that you are fixated on terminology
>>>> while
>>>> I'm trying to explain myself largely using the google translator. By
>>>> specialized function (this is the google translation) I mean a function
>>>> that has return values and parameters different from the inte type so
>>>> not like:
>>>>
>>>> int foo(int)
>>>>
>>>> You could, however, propose to the newsgroup manager that non-native
>>>> English speakers should not use it... or become less meticulous.
>>>
>>> Also I would like to add that the concept of 'standard' that you follow
>>> with religious attention, IMO, is wrong because up to now it has not
>>> evolved but it has changed and this is insane. 'Standard' is a luxury
>>> for programming theorists. Thousands of companies use decades-old
>>> compilers so they don't have to change millions of lines of currently
>>> working code. The 'standard' should be followed by compiler makers and
>>> not compiler users. In the discussion of this thread we discuss a
>>> ternary operator which returns 0 in one rung and a pointer in the other.
>>> The standard says that 0 can be raised to a null pointer and it is true
>>
>> Well, I've worked with systems where a null pointer was represented by
>> the 32-bit value 0xc0eeeeee.    So you can't make assumptions, just use
>> NULL (or nullptr in C++).
>>
> hmm...so we agree, right?
>

....meaning that if the standard says that 0 if pointer will match a null
pointer, the compiler on that system will take care of using the null
pointer when it sees 0 as a pointer. Otherwise what is the standard for?
The problem will be when the standard is changed again.

Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<87h6tnhbx7.fsf@nosuchdomain.example.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan
Date: Mon, 10 Apr 2023 10:41:56 -0700
Organization: None to speak of
Lines: 62
Message-ID: <87h6tnhbx7.fsf@nosuchdomain.example.com>
References: <u0fn0g$34scf$1@dont-email.me> <u0uk66$1or41$1@dont-email.me>
<u0v3vh$df3$1@reader2.panix.com> <u10erc$23rhg$1@dont-email.me>
<u117rb$9r2$2@reader2.panix.com> <u11a0u$27j9d$1@dont-email.me>
<u11b4s$27go8$2@dont-email.me> <u11ccu$27v2q$1@dont-email.me>
<e5916e17-dbdc-4c81-a307-a16be989b3cen@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="d6e20649d7415fd7e1f46f27e74936ae";
logging-data="2383842"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19zMFqVMcDDtcyDr0J738Vo"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:kcYwfgl4YMd2QlL2E1+P4RH9XiQ=
sha1:1V0qpS6YZUd7Fh0MSWf8OB6fL5E=
 by: Keith Thompson - Mon, 10 Apr 2023 17:41 UTC

Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
> On Monday, 10 April 2023 at 17:10:19 UTC+1, jak wrote:
>> James Kuyper ha scritto:
>> > On 4/10/23 11:29, jak wrote:
>> > ...
>> >> char val;
>> >> int *pi;
>> >>
>> >> pi = (int *)&val;
>> >>
>> >> because if you assigned a value to *pi you would be using unallocated
>> >> memory
>> >
>> > The problem with that code has nothing to do with the problem Tim was
>> > talking about, nor does it have anything to do with unallocated memory.
>> > It has undefined behavior if &val points to a memory location that is
>> > not correctly aligned to hold an 'int' (6.3.2.3p7). More importantly,
>> > even if it is correctly aligned, the value stored in pi cannot be used
>> > to access an 'int', because it doesn't point at an int object.
>> >
>> >> ... and if you really want to do that you need a left cast:
>> >>
>> >> ((char *)pi) = &val;
>> >
>> > The left hand side of an assignment is required to be a modifiable
>> > lvalue (6.5.16p2). The result of a pointer conversion is not an lvalue.
>> >
>> hmmm... in my point of view declaring a variable corresponds to
>> allocating memory while using malloc means allocating memory
>> dynamically. For me it is not easy to express concepts in your language
>> and in addition you continue to take me back on the quibbles. Maybe we
>> can talk again when I improve my English and you're less picky.
>>
> In a sense that is right. But generally the term "allocating" isn't used for
> variables created on the stack, unless maybe for large arrays.
> The reason is that the stack works by magic. Within the confines of the
> C language, there is no way to express that the stack might fail, though
> of course it must do so eventually if allowed to get arbitrarily deep.

In fact the word "allocate" and various forms of it *are* commonly used
by the standard to refer to "variables created on the stack" (more
technically, objects with automatic storage duration).

One example (which happens to be one of the earliest references in the
text of the standard):

An *array type* describes a contiguously allocated nonempty set of
objects with a particular member object type, called the *element
type*.

This refers to array objects in general, not just heap-allocated array
objects.

The fact that one of the four storage durations is called "allocated",
while the word "allocate" is used to refer to reserving memory in other
contexts, is potentially confusing, but I haven't found it to be much of
a problem.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for XCOM Labs
void Void(void) { Void(); } /* The recursive call of the void */


devel / comp.lang.c / Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

Pages:12345678
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor