Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Linux, the way to get rid of boot viruses -- MaDsen Wikholm, mwikholm@at8.abo.fi


devel / comp.lang.c / "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
"Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan

<u0fn0g$34scf$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: lynnmcgu...@gmail.com (Lynn McGuire)
Newsgroups: comp.lang.c
Subject: "Catch-23: The New C Standard,Sets the World on Fire" by Terence
Kelly with Special Guest Borer Yekai Pan
Date: Mon, 3 Apr 2023 18:20:48 -0500
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <u0fn0g$34scf$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 3 Apr 2023 23:20:48 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ee24ad93a4eac65f0f83b51248213ff2";
logging-data="3305871"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18gFtVM0U/Dz52HltjA1QWeYogol5eGlQ4="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.9.1
Cancel-Lock: sha1:bQdXBrFI65CdABZuChlzXKvKH/E=
Content-Language: en-US
 by: Lynn McGuire - Mon, 3 Apr 2023 23:20 UTC

"Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly
with Special Guest Borer Yekai Pan
https://queue.acm.org/detail.cfm?id=3588242

"The Good News

A new major revision of the C language standard, C23, is due out this
year. We'll tour the highs and lows of the latest draft9 and then drill
down on the mother of all breaking changes. Sidebars celebrate C idioms
and undefined behavior with code and song, respectively."

"Unfilled Potholes and Festering Sores

Laws should be freely available, intelligible, and agreeable to the
governed, and they should keep pace with changing times. C23 lacks these
virtues."

Wow.

Lynn

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

<u0g2kv$3iqib$1@paganini.bofh.team>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!paganini.bofh.team!not-for-mail
From: inva...@invalid.net (Jim Kelly)
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: Tue, 4 Apr 2023 04:00:00 +0100
Organization: To protect and to server
Message-ID: <u0g2kv$3iqib$1@paganini.bofh.team>
References: <u0fn0g$34scf$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain;
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 4 Apr 2023 02:39:27 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="3762763"; posting-host="lvwnlrZOTyXOUFTBTyWy3g.user.paganini.bofh.team"; mail-complaints-to="usenet@bofh.team"; posting-account="9dIQLXBM7WM9KzA+yjdR4A";
Cancel-Lock: sha256:yq0XcOhbL/dD8cyPDd4QVAj+oFKN74cxmadmqz6+Iss=
X-Notice: Filtered by postfilter v. 0.9.3
Content-Language: en-US
 by: Jim Kelly - Tue, 4 Apr 2023 03:00 UTC

On 04/04/2023 00:20, Lynn McGuire wrote:
> "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly
> with Special Guest Borer Yekai Pan
> �� https://queue.acm.org/detail.cfm?id=3588242
>

The same document in pdf format:

<https://dl.acm.org/doi/pdf/10.1145/3588242>

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

<u0gs80$3cmm0$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: mai...@rkta.de (Rene Kita)
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: Tue, 4 Apr 2023 09:56:18 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 6
Message-ID: <u0gs80$3cmm0$1@dont-email.me>
References: <u0fn0g$34scf$1@dont-email.me>
Injection-Date: Tue, 4 Apr 2023 09:56:18 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="08f35ae115d04b4104696baf5701863b";
logging-data="3562176"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19pdidn8vrsq8vmFht0cbNv"
User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/5.10.0-21-amd64 (x86_64))
Cancel-Lock: sha1:t+q3daDRIM/ThljttfVlfm6nXTQ=
 by: Rene Kita - Tue, 4 Apr 2023 09:56 UTC

Lynn McGuire <lynnmcguire5@gmail.com> wrote:
> "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly
> with Special Guest Borer Yekai Pan
> https://queue.acm.org/detail.cfm?id=3588242

That was an interesting read. I stick to C99 I'll guess.

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

<u0h1p8$ip0$1@reader2.panix.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!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: Tue, 4 Apr 2023 11:30:48 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <u0h1p8$ip0$1@reader2.panix.com>
References: <u0fn0g$34scf$1@dont-email.me>
Injection-Date: Tue, 4 Apr 2023 11:30:48 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80";
logging-data="19232"; 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 - Tue, 4 Apr 2023 11:30 UTC

In article <u0fn0g$34scf$1@dont-email.me>,
Lynn McGuire <lynnmcguire5@gmail.com> wrote:
>"Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly
>with Special Guest Borer Yekai Pan
> https://queue.acm.org/detail.cfm?id=3588242
>[snip]

Yikes. That article is truly awful.

ACM should be ashamed.

- Dan C.

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

<u0h4n4$1usij$1@news.xmission.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
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: Tue, 4 Apr 2023 12:20:52 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <u0h4n4$1usij$1@news.xmission.com>
References: <u0fn0g$34scf$1@dont-email.me> <u0gs80$3cmm0$1@dont-email.me>
Injection-Date: Tue, 4 Apr 2023 12:20:52 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="2060883"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Tue, 4 Apr 2023 12:20 UTC

In article <u0gs80$3cmm0$1@dont-email.me>, Rene Kita <mail@rkta.de> wrote:
>Lynn McGuire <lynnmcguire5@gmail.com> wrote:
>> "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly
>> with Special Guest Borer Yekai Pan
>> https://queue.acm.org/detail.cfm?id=3588242
>
>That was an interesting read. I stick to C99 I'll guess.

Just out of curiosity, what *is* the big breaking change?

--
The randomly chosen signature file that would have appeared here is more than 4
lines long. As such, it violates one or more Usenet RFCs. In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
http://user.xmission.com/~gazelle/Sigs/Snicker

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

<jWVWL.261625$Sgyc.172759@fx40.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer01.ams4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx40.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> <u0gs80$3cmm0$1@dont-email.me> <u0h4n4$1usij$1@news.xmission.com>
Lines: 12
Message-ID: <jWVWL.261625$Sgyc.172759@fx40.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 04 Apr 2023 13:50:07 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 04 Apr 2023 13:50:07 GMT
X-Received-Bytes: 1317
 by: Scott Lurndal - Tue, 4 Apr 2023 13:50 UTC

gazelle@shell.xmission.com (Kenny McCormack) writes:
>In article <u0gs80$3cmm0$1@dont-email.me>, Rene Kita <mail@rkta.de> wrote:
>>Lynn McGuire <lynnmcguire5@gmail.com> wrote:
>>> "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly
>>> with Special Guest Borer Yekai Pan
>>> https://queue.acm.org/detail.cfm?id=3588242
>>
>>That was an interesting read. I stick to C99 I'll guess.
>
>Just out of curiosity, what *is* the big breaking change?

A fatal change in the semantics of 'realloc'.

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

<u0huve$3hrar$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: lynnmcgu...@gmail.com (Lynn McGuire)
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: Tue, 4 Apr 2023 14:49:00 -0500
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <u0huve$3hrar$1@dont-email.me>
References: <u0fn0g$34scf$1@dont-email.me> <u0g2kv$3iqib$1@paganini.bofh.team>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 4 Apr 2023 19:49:02 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ee24ad93a4eac65f0f83b51248213ff2";
logging-data="3730779"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19XLULXy3JYj3egdRhaFgsWRCt7whLHeeU="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.9.1
Cancel-Lock: sha1:MB3X1eZofmhGOOlvIBiVqlMMpWo=
Content-Language: en-US
In-Reply-To: <u0g2kv$3iqib$1@paganini.bofh.team>
 by: Lynn McGuire - Tue, 4 Apr 2023 19:49 UTC

On 4/3/2023 10:00 PM, Jim Kelly wrote:
> On 04/04/2023 00:20, Lynn McGuire wrote:
>> "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly
>> with Special Guest Borer Yekai Pan
>>    https://queue.acm.org/detail.cfm?id=3588242
>>
>
> The same document in pdf format:
>
> <https://dl.acm.org/doi/pdf/10.1145/3588242>

Thanks, I should have added that also.

Lynn

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

<u0hv4n$3hrar$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: lynnmcgu...@gmail.com (Lynn McGuire)
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: Tue, 4 Apr 2023 14:51:49 -0500
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <u0hv4n$3hrar$2@dont-email.me>
References: <u0fn0g$34scf$1@dont-email.me> <u0h1p8$ip0$1@reader2.panix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 4 Apr 2023 19:51:52 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ee24ad93a4eac65f0f83b51248213ff2";
logging-data="3730779"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19aTshoTHkoVoT75rPUpwfkyxBYsITHaoA="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.9.1
Cancel-Lock: sha1:RTBKIn5IVf+6O75EatXQg8+W1fI=
Content-Language: en-US
In-Reply-To: <u0h1p8$ip0$1@reader2.panix.com>
 by: Lynn McGuire - Tue, 4 Apr 2023 19:51 UTC

On 4/4/2023 6:30 AM, Dan Cross wrote:
> In article <u0fn0g$34scf$1@dont-email.me>,
> Lynn McGuire <lynnmcguire5@gmail.com> wrote:
>> "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly
>> with Special Guest Borer Yekai Pan
>> https://queue.acm.org/detail.cfm?id=3588242
>> [snip]
>
> Yikes. That article is truly awful.
>
> ACM should be ashamed.
>
> - Dan C.

Written by real programmers, not journalists. What do you expect ? Not
everyone is Donald Knuth or Niklaus Wirth.

Lynn

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

<87zg7n89zw.fsf@bsb.me.uk>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
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: Wed, 05 Apr 2023 01:10:11 +0100
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <87zg7n89zw.fsf@bsb.me.uk>
References: <u0fn0g$34scf$1@dont-email.me> <u0h1p8$ip0$1@reader2.panix.com>
<u0hv4n$3hrar$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="e8b392b78b32fe2629f9cd7ce6361b53";
logging-data="3809868"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Z1LNKceVP7SV7fMlXYGmpP6MXlArmK9c="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:6/fVIVNv7KmtQAy7mOSRWyhi5Aw=
sha1:eFGE/VSmOvS9t7rFrQqMxux4FLE=
X-BSB-Auth: 1.35603b7bf95d708772e3.20230405011011BST.87zg7n89zw.fsf@bsb.me.uk
 by: Ben Bacarisse - Wed, 5 Apr 2023 00:10 UTC

Lynn McGuire <lynnmcguire5@gmail.com> writes:

> On 4/4/2023 6:30 AM, Dan Cross wrote:
>> In article <u0fn0g$34scf$1@dont-email.me>,
>> Lynn McGuire <lynnmcguire5@gmail.com> wrote:
>>> "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly
>>> with Special Guest Borer Yekai Pan
>>> https://queue.acm.org/detail.cfm?id=3588242
>>> [snip]
>> Yikes. That article is truly awful.
>> ACM should be ashamed.
>> - Dan C.
>
> Written by real programmers, not journalists. What do you expect ? Not
> everyone is Donald Knuth or Niklaus Wirth.

I would expect a more serious tone from an ACM publication, but the
journal (ACMQUEUE) is one I don't know and it may well have a more
relaxed editorial policy than I am used to. I don't like hyperbole and
sarcasm in technical publications but I am not "down with the kids"
these days.

But their example stack code lends itself to a puzzle: on what
implementation assumptions does it depend? I believe it is not fully
portable for reasons that are unrelated to the realloc implementation.
This is not, technically speaking, a bug since I have no reason to
suppose the code was intended to be portable across all conforming C
implementations, but I'd have pointed it out, had I been a reviewer,
since it's an unnecessary distraction to the reader.

I agree with the authors that the change declaring realloc(..., 0) to be
undefined is worrying, but I can't follow their reasoning about the
history. They suggest something had already happened in C17 that set C
on a course towards this "breaking change" but I can't find what they
refer to.

--
Ben.

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

<u0ig61$64g$1@reader2.panix.com>

  copy mid

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

  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: Wed, 5 Apr 2023 00:42:41 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <u0ig61$64g$1@reader2.panix.com>
References: <u0fn0g$34scf$1@dont-email.me> <u0h1p8$ip0$1@reader2.panix.com> <u0hv4n$3hrar$2@dont-email.me> <87zg7n89zw.fsf@bsb.me.uk>
Injection-Date: Wed, 5 Apr 2023 00:42:41 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80";
logging-data="6288"; 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 - Wed, 5 Apr 2023 00:42 UTC

In article <87zg7n89zw.fsf@bsb.me.uk>,
Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:
>Lynn McGuire <lynnmcguire5@gmail.com> writes:
>
>> On 4/4/2023 6:30 AM, Dan Cross wrote:
>>> In article <u0fn0g$34scf$1@dont-email.me>,
>>> Lynn McGuire <lynnmcguire5@gmail.com> wrote:
>>>> "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly
>>>> with Special Guest Borer Yekai Pan
>>>> https://queue.acm.org/detail.cfm?id=3588242
>>>> [snip]
>>> Yikes. That article is truly awful.
>>> ACM should be ashamed.
>>> - Dan C.
>>
>> Written by real programmers, not journalists. What do you expect ? Not
>> everyone is Donald Knuth or Niklaus Wirth.
>
>I would expect a more serious tone from an ACM publication, but the
>journal (ACMQUEUE) is one I don't know and it may well have a more
>relaxed editorial policy than I am used to. I don't like hyperbole and
>sarcasm in technical publications but I am not "down with the kids"
>these days.
>
>But their example stack code lends itself to a puzzle: on what
>implementation assumptions does it depend? I believe it is not fully
>portable for reasons that are unrelated to the realloc implementation.
>This is not, technically speaking, a bug since I have no reason to
>suppose the code was intended to be portable across all conforming C
>implementations, but I'd have pointed it out, had I been a reviewer,
>since it's an unnecessary distraction to the reader.
>
>I agree with the authors that the change declaring realloc(..., 0) to be
>undefined is worrying, but I can't follow their reasoning about the
>history. They suggest something had already happened in C17 that set C
>on a course towards this "breaking change" but I can't find what they
>refer to.

The authors, bluntly, wrong: the behavior of realloc() when the
size argument is 0, the implementation is, as it always has
been since C89, implementation defined. Moreoever, there's no
way to tell whether the underlying object was actually free'd or
not from the return alone, and checking `errno` is not portable.
The proposal to make realloc with size 0 UB is not bad here:
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2464.pdf

The authors tried to make it out like their code was portable
and well-defined. It was not.

That combined with the little quips about "neurodivergent" ideas
or about marijuana legalization (really?) smack of proud
ignorance. That they can't understand at all what `unreachable`
may be used for makes me think that they may not have as good of
a handle on the language as they claim.

Oh, and among the people championing having `malloc(0)` return a
non-NULL pointer were Rob Pike and Doug McIlroy. Not that one
need appeal to authority, but the article's authors would have
done well to at least, perhaps, listen to some of the viewpoints
of folks from the lab where C was born before pouring derision
on ideas that they didn't seem to have a great understanding of.

- Dan C.

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

<u0igup$3kgn0$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: ifo...@youknew.org (Opus)
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: Wed, 5 Apr 2023 02:55:36 +0200
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <u0igup$3kgn0$1@dont-email.me>
References: <u0fn0g$34scf$1@dont-email.me> <u0h1p8$ip0$1@reader2.panix.com>
<u0hv4n$3hrar$2@dont-email.me> <87zg7n89zw.fsf@bsb.me.uk>
<u0ig61$64g$1@reader2.panix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 5 Apr 2023 00:55:53 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c8c844d13031c9e20d43cc8286338036";
logging-data="3818208"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+oMtc2ZYVosFtkTadCGrdr"
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.9.1
Cancel-Lock: sha1:58QHAV6fW/qYAOTJTrd3FzkF6/M=
Content-Language: fr
In-Reply-To: <u0ig61$64g$1@reader2.panix.com>
 by: Opus - Wed, 5 Apr 2023 00:55 UTC

Le 05/04/2023 à 02:42, Dan Cross a écrit :
> The authors, bluntly, wrong: the behavior of realloc() when the
> size argument is 0, the implementation is, as it always has
> been since C89, implementation defined.

Yes, it's actually the case for all memory allocation functions (malloc,
calloc, realloc):
" If the size of the space requested is zero, the behavior is
implementation-defined: either a null pointer is returned, or the
behavior is as if the size were some nonzero value, except that
the returned pointer shall not be used to access an object."

> The authors tried to make it out like their code was portable
> and well-defined. It was not.

Indeed. If you use implementationd-defined behaviors, you should know
what to expect and document it appropriately. Do not expect it to still
be doing what you expected with any other implementation.

I've personally never used this implementation-defined behavior and try
to avoid all of them in general as much as is practical.

> That combined with the little quips about "neurodivergent" ideas
> or about marijuana legalization (really?) smack of proud
> ignorance. That they can't understand at all what `unreachable`
> may be used for makes me think that they may not have as good of
> a handle on the language as they claim.

It read a bit like a tantrum with a clickbaity title.

> Oh, and among the people championing having `malloc(0)` return a
> non-NULL pointer were Rob Pike and Doug McIlroy. Not that one
> need appeal to authority, but the article's authors would have
> done well to at least, perhaps, listen to some of the viewpoints
> of folks from the lab where C was born before pouring derision
> on ideas that they didn't seem to have a great understanding of.

malloc(0) has the same behavior as realloc(xx, 0) as I quoted above.
The behavior is implementation-defined, and even when it does not return
a null pointer, you're not supposed to dereference it.

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

<44v8ib15yl.fsf@be-well.ilk.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: lguse...@be-well.ilk.org (Lowell Gilbert)
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: Tue, 04 Apr 2023 21:19:14 -0400
Organization: A noiseless patient Spider
Lines: 56
Message-ID: <44v8ib15yl.fsf@be-well.ilk.org>
References: <u0fn0g$34scf$1@dont-email.me> <u0h1p8$ip0$1@reader2.panix.com>
<u0hv4n$3hrar$2@dont-email.me> <87zg7n89zw.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="a819471eaa14ac45faf767c358209936";
logging-data="3827200"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18nBXQeRehuYNvI+3wyrNQc"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:vsiL+xIk69dQsslFO8A3lE3N9ws=
sha1:ZBgA6oFZOD2S7W3uK7CQfxiwqr8=
 by: Lowell Gilbert - Wed, 5 Apr 2023 01:19 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> writes:

> Lynn McGuire <lynnmcguire5@gmail.com> writes:
>
>> On 4/4/2023 6:30 AM, Dan Cross wrote:
>>> In article <u0fn0g$34scf$1@dont-email.me>,
>>> Lynn McGuire <lynnmcguire5@gmail.com> wrote:
>>>> "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly
>>>> with Special Guest Borer Yekai Pan
>>>> https://queue.acm.org/detail.cfm?id=3588242
>>>> [snip]
>>> Yikes. That article is truly awful.
>>> ACM should be ashamed.
>>> - Dan C.
>>
>> Written by real programmers, not journalists. What do you expect ? Not
>> everyone is Donald Knuth or Niklaus Wirth.
>
> I would expect a more serious tone from an ACM publication, but the
> journal (ACMQUEUE) is one I don't know and it may well have a more
> relaxed editorial policy than I am used to. I don't like hyperbole and
> sarcasm in technical publications but I am not "down with the kids"
> these days.

Queue is Not An Academic Journal. Because, apparently, working software
professionals never read academic journals, so it's critical to make
clear that they aren't one.

Not that they're necessarily all that wrong.

> I agree with the authors that the change declaring realloc(..., 0) to be
> undefined is worrying, but I can't follow their reasoning about the
> history. They suggest something had already happened in C17 that set C
> on a course towards this "breaking change" but I can't find what they
> refer to.

I think they're saying that before C17, realloc to a size of zero was
implementation defined, and that C17 changed that to it being
undefined. That isn't quite right, because it was implementation-defined
both before and after. But (I think; I don't have a full copy of C17 at
hand) the limitations were changed, and realloc to a size of zero was
explicitly described as obsolescent. Unless I'm mistaken factually
(possible, as I mentioned) I think it's reasonable to consider
C17 to be moving towards disallowing the behaviour.

The article's author(s) liked being able to assume that realloc to zero
size would reliably be equivalent to freeing the object pointed to and
setting the pointer to null. This was never a portable assumption, but
their implementation no longer has the option of specifying the
behaviour. This does cause what previously may have been perfectly
reasonable code to now be undefined.

Be well.
--
Lowell Gilbert, embedded/networking software engineer
http://be-well.ilk.org/~lowell/

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

<874jpv84uv.fsf@bsb.me.uk>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
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: Wed, 05 Apr 2023 03:01:12 +0100
Organization: A noiseless patient Spider
Lines: 97
Message-ID: <874jpv84uv.fsf@bsb.me.uk>
References: <u0fn0g$34scf$1@dont-email.me> <u0h1p8$ip0$1@reader2.panix.com>
<u0hv4n$3hrar$2@dont-email.me> <87zg7n89zw.fsf@bsb.me.uk>
<u0ig61$64g$1@reader2.panix.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="e8b392b78b32fe2629f9cd7ce6361b53";
logging-data="3929697"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19L6Lc2XQcRjS7ipiBJPRDX/lH3ENbAGlQ="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:A3bpr3Gf/OQKVOjqsDY5/USU1gU=
sha1:/l1uawDM7Wglfo6Gf9g6+BsWXTQ=
X-BSB-Auth: 1.c6c0777789d7a55c5db5.20230405030112BST.874jpv84uv.fsf@bsb.me.uk
 by: Ben Bacarisse - Wed, 5 Apr 2023 02:01 UTC

cross@spitfire.i.gajendra.net (Dan Cross) writes:

> In article <87zg7n89zw.fsf@bsb.me.uk>,
> Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:
>>Lynn McGuire <lynnmcguire5@gmail.com> writes:
>>
>>> On 4/4/2023 6:30 AM, Dan Cross wrote:
>>>> In article <u0fn0g$34scf$1@dont-email.me>,
>>>> Lynn McGuire <lynnmcguire5@gmail.com> wrote:
>>>>> "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly
>>>>> with Special Guest Borer Yekai Pan
>>>>> https://queue.acm.org/detail.cfm?id=3588242
>>>>> [snip]
>>>> Yikes. That article is truly awful.
>>>> ACM should be ashamed.
>>>> - Dan C.
>>>
>>> Written by real programmers, not journalists. What do you expect ? Not
>>> everyone is Donald Knuth or Niklaus Wirth.
>>
>>I would expect a more serious tone from an ACM publication, but the
>>journal (ACMQUEUE) is one I don't know and it may well have a more
>>relaxed editorial policy than I am used to. I don't like hyperbole and
>>sarcasm in technical publications but I am not "down with the kids"
>>these days.
>>
>>But their example stack code lends itself to a puzzle: on what
>>implementation assumptions does it depend? I believe it is not fully
>>portable for reasons that are unrelated to the realloc implementation.
>>This is not, technically speaking, a bug since I have no reason to
>>suppose the code was intended to be portable across all conforming C
>>implementations, but I'd have pointed it out, had I been a reviewer,
>>since it's an unnecessary distraction to the reader.
>>
>>I agree with the authors that the change declaring realloc(..., 0) to be
>>undefined is worrying, but I can't follow their reasoning about the
>>history. They suggest something had already happened in C17 that set C
>>on a course towards this "breaking change" but I can't find what they
>>refer to.
>
> The authors, bluntly, wrong: the behavior of realloc() when the
> size argument is 0, the implementation is, as it always has
> been since C89, implementation defined.

I got the impression they knew that. However, in C89, realloc(ptr, 0)
must behave like free(ptr). That changed, I think, in C99 with the
removal of that guarantee. There is some evidence that they are little
confused about that guarantee having been lost, thought of course it is
still permitted.

> Moreoever, there's no
> way to tell whether the underlying object was actually free'd or
> not from the return alone, and checking `errno` is not portable.

Yes.

> The proposal to make realloc with size 0 UB is not bad here:
> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2464.pdf

I did not see any explanation there. What's wrong with leaving it
implementation defined? Is the motivation to tidy up an historical
mess?

> The authors tried to make it out like their code was portable
> and well-defined. It was not.

I did not get that impression. I thought their point was simply that
the code is not undefined and that being implementation defined is safer
than being undefined.

I think the code is poor, and I would not want it in any code base of
mine. It can leak memory (in two different ways) but it does not have
formally undefined behaviour.

> That combined with the little quips about "neurodivergent" ideas
> or about marijuana legalization (really?) smack of proud
> ignorance. That they can't understand at all what `unreachable`
> may be used for makes me think that they may not have as good of
> a handle on the language as they claim.

I didn't like the tone at all, and I was actually rather surprised by
it, given the publisher. But maybe that specific journal is not a very
serious one. I'd never heard of it before today.

> Oh, and among the people championing having `malloc(0)` return a
> non-NULL pointer were Rob Pike and Doug McIlroy. Not that one
> need appeal to authority, but the article's authors would have
> done well to at least, perhaps, listen to some of the viewpoints
> of folks from the lab where C was born before pouring derision
> on ideas that they didn't seem to have a great understanding of.

They didn't discuss that implementation option at all and I agree that
they should have done. But did they pour scorn on it? I only ask
because I don't want to read it again!

--
Ben.

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

<87sfdf6ooe.fsf@bsb.me.uk>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
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: Wed, 05 Apr 2023 03:36:01 +0100
Organization: A noiseless patient Spider
Lines: 91
Message-ID: <87sfdf6ooe.fsf@bsb.me.uk>
References: <u0fn0g$34scf$1@dont-email.me> <u0h1p8$ip0$1@reader2.panix.com>
<u0hv4n$3hrar$2@dont-email.me> <87zg7n89zw.fsf@bsb.me.uk>
<44v8ib15yl.fsf@be-well.ilk.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="e8b392b78b32fe2629f9cd7ce6361b53";
logging-data="3938937"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+mqjsq+Ogn75mXSxu0RZRbMO+SOLoMw0c="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:cUoyAYcCcQKoK9ImZoqjroucd8s=
sha1:WcWiZMGoHyGtKqVCJX2qxMJYhJg=
X-BSB-Auth: 1.8c62929b88776725f08e.20230405033601BST.87sfdf6ooe.fsf@bsb.me.uk
 by: Ben Bacarisse - Wed, 5 Apr 2023 02:36 UTC

Lowell Gilbert <lgusenet@be-well.ilk.org> writes:

> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>
>> Lynn McGuire <lynnmcguire5@gmail.com> writes:
>>
>>> On 4/4/2023 6:30 AM, Dan Cross wrote:
>>>> In article <u0fn0g$34scf$1@dont-email.me>,
>>>> Lynn McGuire <lynnmcguire5@gmail.com> wrote:
>>>>> "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly
>>>>> with Special Guest Borer Yekai Pan
>>>>> https://queue.acm.org/detail.cfm?id=3588242
>>>>> [snip]
>>>> Yikes. That article is truly awful.
>>>> ACM should be ashamed.
>>>> - Dan C.
>>>
>>> Written by real programmers, not journalists. What do you expect ? Not
>>> everyone is Donald Knuth or Niklaus Wirth.
>>
>> I would expect a more serious tone from an ACM publication, but the
>> journal (ACMQUEUE) is one I don't know and it may well have a more
>> relaxed editorial policy than I am used to. I don't like hyperbole and
>> sarcasm in technical publications but I am not "down with the kids"
>> these days.
>
> Queue is Not An Academic Journal. Because, apparently, working software
> professionals never read academic journals, so it's critical to make
> clear that they aren't one.
>
> Not that they're necessarily all that wrong.

Yes, I see it's described as a magazine.

>> I agree with the authors that the change declaring realloc(..., 0) to be
>> undefined is worrying, but I can't follow their reasoning about the
>> history. They suggest something had already happened in C17 that set C
>> on a course towards this "breaking change" but I can't find what they
>> refer to.
>
> I think they're saying that before C17, realloc to a size of zero was
> implementation defined, and that C17 changed that to it being
> undefined. That isn't quite right, because it was implementation-defined
> both before and after. But (I think; I don't have a full copy of C17 at
> hand) the limitations were changed, and realloc to a size of zero was
> explicitly described as obsolescent. Unless I'm mistaken factually
> (possible, as I mentioned) I think it's reasonable to consider
> C17 to be moving towards disallowing the behaviour.

I only have a draft of C17. The fact that C standards cost a lot of
money is a valid point. I can't justify paying anything just to be able
to chat on comp.lang.c about some finer points.

The draft I have suggests that C17 just codified what implementation
currently do:

"If the size of the space requested is zero, the behavior is
implementation-defined: either a null pointer is returned to indicate
an error, or the behavior is as if the size were some nonzero value,
except that the returned pointer shall not be used to access an
object."

and more specifically in realloc:

"If size is zero and memory for the new object is not allocated, it is
implementation-defined whether the old object is deallocated. If the
old object is not deallocated, its value shall be unchanged."

But this may not be the final wording.

> The article's author(s) liked being able to assume that realloc to
> zero size would reliably be equivalent to freeing the object pointed
> to and setting the pointer to null.

.... and returning a null pointer.

> This was never a portable
> assumption, but their implementation no longer has the option of
> specifying the behaviour. This does cause what previously may have
> been perfectly reasonable code to now be undefined.

I don't think the code was ever perfectly reasonable, but I took their
point to be simply that it was not undefined as it will become.

I was probably being a bit generous. I thought they knew is was not
good code, but that it was, at least, never undefined because care was
taken with the use of the returned pointer and it does not assume that
realloc(ptr, 0) return NULL.

--
Ben.

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

<u0ior1$3oeqh$3@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: ifo...@youknew.org (Opus)
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: Wed, 5 Apr 2023 05:10:09 +0200
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <u0ior1$3oeqh$3@dont-email.me>
References: <u0fn0g$34scf$1@dont-email.me> <u0h1p8$ip0$1@reader2.panix.com>
<u0hv4n$3hrar$2@dont-email.me> <87zg7n89zw.fsf@bsb.me.uk>
<44v8ib15yl.fsf@be-well.ilk.org> <87sfdf6ooe.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 5 Apr 2023 03:10:25 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c8c844d13031c9e20d43cc8286338036";
logging-data="3947345"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/TmikGEV1bGVwRuWgIA7jM"
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.9.1
Cancel-Lock: sha1:RvNC0vGFq58mDEc1pHV91g5Pq80=
Content-Language: fr
In-Reply-To: <87sfdf6ooe.fsf@bsb.me.uk>
 by: Opus - Wed, 5 Apr 2023 03:10 UTC

Le 05/04/2023 à 04:36, Ben Bacarisse a écrit :
> I don't think the code was ever perfectly reasonable, but I took their
> point to be simply that it was not undefined as it will become.

Yeah, to be fair, in standard versions before C17, this was a bit of a
grey area. While the behavior of realloc (like malloc and calloc)
*regarding the new allocation* was clearly implementation-defined, the
behavior as to the old object passed as parameter was, at best, implicit.

"The realloc function deallocates the old object pointed to by
ptr and returns a pointer to a new object that has the size
specified by size."

The implicit part is that we could assume from the above that whatever
the size parameter is, the realloc function starts by deallocating the
old object, and what happens after that is implementation-defined if
size is 0.

C17 makes it more explicit and definitely makes it clear that even the
deallocation is implementation-defined in this case. So this was at
least known for sure with C17 that the deallocation itself was
implementation-defined. Nothing new.

But the old phrasing was so unexplicit that it was reasonable not to
count on any particular behavior.

Reading the article and the point about the cost of the standard, it's
not completely clear the author(s) had really read the previous versions
very attentively anyway.

What it really shows IMO and is backed up by experience is that many, if
not most C developers have never read the C std anyway and many assume
they know C from their own experience and the behavior of the particular
tools they have used.

Whether this would change if the standard became a free download remains
to be seen. I am skeptical. Drafts are not hard to get ahold of and late
drafts are usually close enough to the final text.

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

<u0jcmt$3r2ce$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: mai...@rkta.de (Rene Kita)
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: Wed, 5 Apr 2023 08:49:35 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <u0jcmt$3r2ce$1@dont-email.me>
References: <u0fn0g$34scf$1@dont-email.me> <u0gs80$3cmm0$1@dont-email.me> <u0h4n4$1usij$1@news.xmission.com>
Injection-Date: Wed, 5 Apr 2023 08:49:35 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="435d90be9d522633fc90b2c7178adad3";
logging-data="4032910"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+UeoO0TLMUrAj0O1dIbsFD"
User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/5.10.0-21-amd64 (x86_64))
Cancel-Lock: sha1:D9HJY7Tfi6HXnsF06ENmXlv/aV8=
 by: Rene Kita - Wed, 5 Apr 2023 08:49 UTC

Kenny McCormack <gazelle@shell.xmission.com> wrote:
> In article <u0gs80$3cmm0$1@dont-email.me>, Rene Kita <mail@rkta.de> wrote:
>>Lynn McGuire <lynnmcguire5@gmail.com> wrote:
>>> "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly
>>> with Special Guest Borer Yekai Pan
>>> https://queue.acm.org/detail.cfm?id=3588242
>>
>>That was an interesting read. I stick to C99 I'll guess.
>
> Just out of curiosity, what *is* the big breaking change?

realloc with a size of zero is UB in C23.

There was some extended discussion on HN[0].

[0]: https://news.ycombinator.com/item?id=35404025

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

<u0jem9$2033d$1@news.xmission.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
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: Wed, 5 Apr 2023 09:23:21 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <u0jem9$2033d$1@news.xmission.com>
References: <u0fn0g$34scf$1@dont-email.me> <u0gs80$3cmm0$1@dont-email.me> <u0h4n4$1usij$1@news.xmission.com> <u0jcmt$3r2ce$1@dont-email.me>
Injection-Date: Wed, 5 Apr 2023 09:23:21 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="2100333"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Wed, 5 Apr 2023 09:23 UTC

In article <u0jcmt$3r2ce$1@dont-email.me>, Rene Kita <mail@rkta.de> wrote:
>Kenny McCormack <gazelle@shell.xmission.com> wrote:
>> In article <u0gs80$3cmm0$1@dont-email.me>, Rene Kita <mail@rkta.de> wrote:
>>>Lynn McGuire <lynnmcguire5@gmail.com> wrote:
>>>> "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly
>>>> with Special Guest Borer Yekai Pan
>>>> https://queue.acm.org/detail.cfm?id=3588242
>>>
>>>That was an interesting read. I stick to C99 I'll guess.
>>
>> Just out of curiosity, what *is* the big breaking change?
>
>realloc with a size of zero is UB in C23.

Interesting.

I had no idea that realloc with a size of zero is (was?) equivalent to a
call to free() - until I read the man page a day or so ago and found that.

So, no more...?

--
The randomly chosen signature file that would have appeared here is more than 4
lines long. As such, it violates one or more Usenet RFCs. In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
http://user.xmission.com/~gazelle/Sigs/RightWingMedia

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

<jkdXL.2028861$9sn9.1277919@fx17.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx17.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.9.1
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence
Kelly with Special Guest Borer Yekai Pan
Content-Language: en-US
Newsgroups: comp.lang.c
References: <u0fn0g$34scf$1@dont-email.me> <u0h1p8$ip0$1@reader2.panix.com>
<u0hv4n$3hrar$2@dont-email.me> <87zg7n89zw.fsf@bsb.me.uk>
<44v8ib15yl.fsf@be-well.ilk.org> <87sfdf6ooe.fsf@bsb.me.uk>
<u0ior1$3oeqh$3@dont-email.me>
From: Rich...@Damon-Family.org (Richard Damon)
In-Reply-To: <u0ior1$3oeqh$3@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 66
Message-ID: <jkdXL.2028861$9sn9.1277919@fx17.iad>
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Wed, 5 Apr 2023 07:54:54 -0400
X-Received-Bytes: 4359
 by: Richard Damon - Wed, 5 Apr 2023 11:54 UTC

On 4/4/23 11:10 PM, Opus wrote:
> Le 05/04/2023 à 04:36, Ben Bacarisse a écrit :
>> I don't think the code was ever perfectly reasonable, but I took their
>> point to be simply that it was not undefined as it will become.
>
> Yeah, to be fair, in standard versions before C17, this was a bit of a
> grey area. While the behavior of realloc (like malloc and calloc)
> *regarding the new allocation* was clearly implementation-defined, the
> behavior as to the old object passed as parameter was, at best, implicit.
>
> "The realloc function  deallocates  the  old  object  pointed  to  by
> ptr and  returns  a pointer  to  a  new object  that  has  the  size
> specified  by size."
>
> The implicit part is that we could assume from the above that whatever
> the size parameter is, the realloc function starts by deallocating the
> old object, and what happens after that is implementation-defined if
> size is 0.
>
> C17 makes it more explicit and definitely makes it clear that even the
> deallocation is implementation-defined in this case. So this was at
> least known for sure with C17 that the deallocation itself was
> implementation-defined. Nothing new.
>
> But the old phrasing was so unexplicit that it was reasonable not to
> count on any particular behavior.
>
> Reading the article and the point about the cost of the standard, it's
> not completely clear the author(s) had really read the previous versions
> very attentively anyway.
>
> What it really shows IMO and is backed up by experience is that many, if
> not most C developers have never read the C std anyway and many assume
> they know C from their own experience and the behavior of the particular
>  tools they have used.
>
> Whether this would change if the standard became a free download remains
> to be seen. I am skeptical. Drafts are not hard to get ahold of and late
> drafts are usually close enough to the final text.
>

The issue is that realloc DOESN'T start by deallocating the old buffer,
but must allocate the new buffer (possibly just resizing the existing
buffer in place), and then copying the data if needed.

One key point is that if the new allocation failed, then the old buffer
was guaranteed to still be allocated and was usable, and this was
indicated by returning a null pointer.

We thus have a conflict in the definition of the API for realloc. If a
zero size parameter means act like free, then realloc has no non-null
value it can return to indicate "success", so needs to return null, but
that means that a null return doesn't mean the input pointer is still valid.

Thus the speciification, and code trying hard to conform to that
specification, needs a lot of words/code to handle the size 0 final case.

Also, this goes back to the idea that malloc could return unique 0-byte
allocations as an implementation option (because some chose to to that
way back when). This is a option that has some uses, but also makes some
code harder to maintain. And for such a system, a call with a 0 size
would return a non-null pointer, so realloc(ptr, 0) wasn't the
equivalent of a free, as it returned a pointer that should eventually be
actually free'd.

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

<u0jrr7$jvd$2@reader2.panix.com>

  copy mid

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

  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: Wed, 5 Apr 2023 13:07:51 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <u0jrr7$jvd$2@reader2.panix.com>
References: <u0fn0g$34scf$1@dont-email.me> <u0h4n4$1usij$1@news.xmission.com> <u0jcmt$3r2ce$1@dont-email.me> <u0jem9$2033d$1@news.xmission.com>
Injection-Date: Wed, 5 Apr 2023 13:07:51 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80";
logging-data="20461"; 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 - Wed, 5 Apr 2023 13:07 UTC

In article <u0jem9$2033d$1@news.xmission.com>,
Kenny McCormack <gazelle@shell.xmission.com> wrote:
>In article <u0jcmt$3r2ce$1@dont-email.me>, Rene Kita <mail@rkta.de> wrote:
>>Kenny McCormack <gazelle@shell.xmission.com> wrote:
>>> In article <u0gs80$3cmm0$1@dont-email.me>, Rene Kita <mail@rkta.de> wrote:
>>>>Lynn McGuire <lynnmcguire5@gmail.com> wrote:
>>>>> "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly
>>>>> with Special Guest Borer Yekai Pan
>>>>> https://queue.acm.org/detail.cfm?id=3588242
>>>>
>>>>That was an interesting read. I stick to C99 I'll guess.
>>>
>>> Just out of curiosity, what *is* the big breaking change?
>>
>>realloc with a size of zero is UB in C23.
>
>Interesting.
>
>I had no idea that realloc with a size of zero is (was?) equivalent to a
>call to free() - until I read the man page a day or so ago and found that.
>
>So, no more...?

The thing is, that is, and always has been, implementation
defined. The authors presented it as a universal property of
all implementations, but it just is not.

To be explicit about it: realloc(ptr, 0); is not, and never has
been, guaranteed to be equivalent to free(ptr).

- Dan C.

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

<u0jt3l$cmu$1@reader2.panix.com>

  copy mid

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

  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: Wed, 5 Apr 2023 13:29:25 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <u0jt3l$cmu$1@reader2.panix.com>
References: <u0fn0g$34scf$1@dont-email.me> <87zg7n89zw.fsf@bsb.me.uk> <u0ig61$64g$1@reader2.panix.com> <874jpv84uv.fsf@bsb.me.uk>
Injection-Date: Wed, 5 Apr 2023 13:29:25 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80";
logging-data="13022"; 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 - Wed, 5 Apr 2023 13:29 UTC

In article <874jpv84uv.fsf@bsb.me.uk>,
Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:
>cross@spitfire.i.gajendra.net (Dan Cross) writes:
>>>[snip]
>>>I agree with the authors that the change declaring realloc(..., 0) to be
>>>undefined is worrying, but I can't follow their reasoning about the
>>>history. They suggest something had already happened in C17 that set C
>>>on a course towards this "breaking change" but I can't find what they
>>>refer to.
>>
>> The authors, bluntly, wrong: the behavior of realloc() when the
>> size argument is 0, the implementation is, as it always has
>> been since C89, implementation defined.
>
>I got the impression they knew that. However, in C89, realloc(ptr, 0)
>must behave like free(ptr). That changed, I think, in C99 with the
>removal of that guarantee. There is some evidence that they are little
>confused about that guarantee having been lost, thought of course it is
>still permitted.

Indeed, you are correct. From C89, 7.10.3.3: "if *size* is zero
and *ptr* is not a null pointer, the object it points to is
freed."

C99 removes that language, presumably because C89 did not
mandate a particular return value for realloc() in the case
where it behaves like free(), meaning that it is impossible
to tell from the return value alone whether it freed anything
or not. Ben, you already know this, for but others who are
reading along, consider the following:

size_t size = SOMETHING;
char *nptr, *ptr = malloc(size);
// Do something. Error checking elided for brevity.
// Assume that somehow, size is set to zero.
nptr = realloc(ptr, size /* 0 */);
if (nptr == NULL) {
// Now what? Did we fail?
// Or did realloc just,
// if (size == 0) free(ptr);
// return ptr;
// ?
return;
}
// So nptr != NULL.... Ok.
ptr = realloc(nptr, size /* still zero... */);
// Did we just double-free? Or did we malloc()?
// Without also checking size, it's impossible to tell.

>> Moreoever, there's no
>> way to tell whether the underlying object was actually free'd or
>> not from the return alone, and checking `errno` is not portable.
>
>Yes.
>
>> The proposal to make realloc with size 0 UB is not bad here:
>> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2464.pdf
>
>I did not see any explanation there. What's wrong with leaving it
>implementation defined? Is the motivation to tidy up an historical
>mess?

I believe that's correct. The original specification in C89 was
arguably a mistake; the interface, as specified, was almost
impossible to use correctly and, as perverse as I find UB in
general, I feel like the committee made the right decision here.

>> The authors tried to make it out like their code was portable
>> and well-defined. It was not.
>
>I did not get that impression. I thought their point was simply that
>the code is not undefined and that being implementation defined is safer
>than being undefined.
>
>I think the code is poor, and I would not want it in any code base of
>mine. It can leak memory (in two different ways) but it does not have
>formally undefined behaviour.

That is true, but the behavior is implementation-defined and on
some platforms, their code will simply be wrong in the sense of
having a memory leak or worse.

>> That combined with the little quips about "neurodivergent" ideas
>> or about marijuana legalization (really?) smack of proud
>> ignorance. That they can't understand at all what `unreachable`
>> may be used for makes me think that they may not have as good of
>> a handle on the language as they claim.
>
>I didn't like the tone at all, and I was actually rather surprised by
>it, given the publisher. But maybe that specific journal is not a very
>serious one. I'd never heard of it before today.

Queue is meant to be, "for the practitioner." But as the
comment I left on the ACM digital library said, this makes
practitioners look ignorant.

I am very disappointed in ACM here.

>> Oh, and among the people championing having `malloc(0)` return a
>> non-NULL pointer were Rob Pike and Doug McIlroy. Not that one
>> need appeal to authority, but the article's authors would have
>> done well to at least, perhaps, listen to some of the viewpoints
>> of folks from the lab where C was born before pouring derision
>> on ideas that they didn't seem to have a great understanding of.
>
>They didn't discuss that implementation option at all and I agree that
>they should have done. But did they pour scorn on it? I only ask
>because I don't want to read it again!

I would argue that they did, yes. They went on at length about
how it zero-sized objects are an incredibly bad idea, without
giving any consideration to _why_ one might want to use one;
they did the same with `unreachable`.

- Dan C.

(realloc) Angels and pins (Was: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan)

<u0jvkb$20c26$1@news.xmission.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.c
Subject: (realloc) Angels and pins (Was: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan)
Date: Wed, 5 Apr 2023 14:12:27 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <u0jvkb$20c26$1@news.xmission.com>
References: <u0fn0g$34scf$1@dont-email.me> <u0jcmt$3r2ce$1@dont-email.me> <u0jem9$2033d$1@news.xmission.com> <u0jrr7$jvd$2@reader2.panix.com>
Injection-Date: Wed, 5 Apr 2023 14:12:27 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="2109510"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Wed, 5 Apr 2023 14:12 UTC

In article <u0jrr7$jvd$2@reader2.panix.com>,
Dan Cross <cross@spitfire.i.gajendra.net> wrote:
....
>To be explicit about it: realloc(ptr, 0); is not, and never has
>been, guaranteed to be equivalent to free(ptr).

It is, on platforms where it is. A tautology, that.

Beyond that, I have no further interest in this, as we'd just be arguing
about angels and pins.

--
People sleep peaceably in their beds at night only because rough
men stand ready to do violence on their behalf.

George Orwell

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

<u0k2mt$3ubl4$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
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: Wed, 5 Apr 2023 17:05:00 +0200
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <u0k2mt$3ubl4$1@dont-email.me>
References: <u0fn0g$34scf$1@dont-email.me> <u0gs80$3cmm0$1@dont-email.me>
<u0h4n4$1usij$1@news.xmission.com> <u0jcmt$3r2ce$1@dont-email.me>
<u0jem9$2033d$1@news.xmission.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 5 Apr 2023 15:05:01 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="44a5ed1923b6ba21b3565d3ccd62575c";
logging-data="4140708"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+qlWAE4Fm8MdPvf8LvS/5GsnoNwnCulLg="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
Thunderbird/60.6.1
Cancel-Lock: sha1:Ot7FszRRS2pKZuCz97BgdHMn3bU=
In-Reply-To: <u0jem9$2033d$1@news.xmission.com>
Content-Language: en-GB
 by: David Brown - Wed, 5 Apr 2023 15:05 UTC

On 05/04/2023 11:23, Kenny McCormack wrote:
> In article <u0jcmt$3r2ce$1@dont-email.me>, Rene Kita <mail@rkta.de> wrote:
>> Kenny McCormack <gazelle@shell.xmission.com> wrote:
>>> In article <u0gs80$3cmm0$1@dont-email.me>, Rene Kita <mail@rkta.de> wrote:
>>>> Lynn McGuire <lynnmcguire5@gmail.com> wrote:
>>>>> "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly
>>>>> with Special Guest Borer Yekai Pan
>>>>> https://queue.acm.org/detail.cfm?id=3588242
>>>>
>>>> That was an interesting read. I stick to C99 I'll guess.
>>>
>>> Just out of curiosity, what *is* the big breaking change?
>>
>> realloc with a size of zero is UB in C23.
>
> Interesting.
>
> I had no idea that realloc with a size of zero is (was?) equivalent to a
> call to free() - until I read the man page a day or so ago and found that.

It isn't equivalent to free(). It is implementation-dependent. And
while /some/ implementations handle it like free(), others do not.
Bizarrely, the article authors seem to believe this is guaranteed
behaviour while also giving references to pages showing a range of
different behaviour in real-world C libraries. (And we are not talking
about old, nice or obscure libraries.)

The article is complete nonsense. It is published 3 days early - it
really is a joke. There is very little justification for their
viewpoints in the standards, and very little match between what they say
is in the standards, and what is really there.

Basically, a particular unusual use-case of realloc has changed from
implementation-dependent behaviour (where the implementations vary so
much you can't use it in portable code) to undefined behaviour (which in
real life means different libraries will continue to keep their current
differing behaviours). And the authors write as though this is the end
of the C world as we know it.

/You/ had no idea what happens when realloc'ing with a size of zero.
That's fine - it's not something that makes much sense, and I doubt if
many programmers know what it does. An even smaller proportion will be
correct in what they think they know. If you are writing sensible and
reasonably portable code, there is no change.

(The article also talks a bit about how difficult the standards
sometimes are to understand - that's true enough, but nothing new in C23.)

>
> So, no more...?
>

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

<u0k3au$3uelq$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
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: Wed, 5 Apr 2023 17:15:42 +0200
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <u0k3au$3uelq$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>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 5 Apr 2023 15:15:42 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="44a5ed1923b6ba21b3565d3ccd62575c";
logging-data="4143802"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/KaSYaYDKfLGvwYJhsbg0vH70aLgZlIBg="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
Thunderbird/60.6.1
Cancel-Lock: sha1:wdLEZhnWZUkNIpHOYGOehnOXLjQ=
In-Reply-To: <u0jt3l$cmu$1@reader2.panix.com>
Content-Language: en-GB
 by: David Brown - Wed, 5 Apr 2023 15:15 UTC

On 05/04/2023 15:29, Dan Cross wrote:
> In article <874jpv84uv.fsf@bsb.me.uk>,
> Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:

>> I got the impression they knew that. However, in C89, realloc(ptr, 0)
>> must behave like free(ptr). That changed, I think, in C99 with the
>> removal of that guarantee. There is some evidence that they are little
>> confused about that guarantee having been lost, thought of course it is
>> still permitted.
>
> Indeed, you are correct. From C89, 7.10.3.3: "if *size* is zero
> and *ptr* is not a null pointer, the object it points to is
> freed."
>

I don't have a C89 reference handy, but I don't think realloc(ptr, 0)
has ever been required to behave like free(ptr). That is one of the
allowed behaviours, but it is not the only one. In particular, even if
it first acts like free(ptr), it can then allocate a zero-size buffer
afterwards. Thus it may not be behaving like free(ptr) alone - it can
do more. And if you don't take that into account, your code will leak
memory.

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

<NrgXL.1274531$MVg8.611500@fx12.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx12.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> <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>
Lines: 32
Message-ID: <NrgXL.1274531$MVg8.611500@fx12.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Wed, 05 Apr 2023 15:27:41 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Wed, 05 Apr 2023 15:27:41 GMT
X-Received-Bytes: 2325
 by: Scott Lurndal - Wed, 5 Apr 2023 15:27 UTC

David Brown <david.brown@hesbynett.no> writes:
>On 05/04/2023 15:29, Dan Cross wrote:
>> In article <874jpv84uv.fsf@bsb.me.uk>,
>> Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:
>
>>> I got the impression they knew that. However, in C89, realloc(ptr, 0)
>>> must behave like free(ptr). That changed, I think, in C99 with the
>>> removal of that guarantee. There is some evidence that they are little
>>> confused about that guarantee having been lost, thought of course it is
>>> still permitted.
>>
>> Indeed, you are correct. From C89, 7.10.3.3: "if *size* is zero
>> and *ptr* is not a null pointer, the object it points to is
>> freed."
>>
>
>I don't have a C89 reference handy, but I don't think realloc(ptr, 0)
>has ever been required to behave like free(ptr). That is one of the
>allowed behaviours, but it is not the only one. In particular, even if
>it first acts like free(ptr), it can then allocate a zero-size buffer
>afterwards. Thus it may not be behaving like free(ptr) alone - it can
>do more. And if you don't take that into account, your code will leak
>memory.

The Single Unix Specification notes:

"If the size of the space requested is zero, the behavior
shall be implementation-defined: either a null pointer is
returned, or the behavior shall be as if the size were some
non-zero value, except that the behavior is undefined if the
returned pointer is used to access an object. If the space
cannot be allocated, the object shall remain unchanged."

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

<86lej65mih.fsf@linuxsc.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
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: Wed, 05 Apr 2023 09:20:22 -0700
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <86lej65mih.fsf@linuxsc.com>
References: <u0fn0g$34scf$1@dont-email.me> <u0h1p8$ip0$1@reader2.panix.com> <u0hv4n$3hrar$2@dont-email.me> <87zg7n89zw.fsf@bsb.me.uk> <44v8ib15yl.fsf@be-well.ilk.org> <87sfdf6ooe.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="3e40893fec19eeb2f5d61a30b72606e6";
logging-data="4160014"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+vSIlarUs3ejoXFGYeI4w3xozH2Q50xQA="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:ZTn+utXparIDM3VcHBsFfO4YoKg=
sha1:E2gJHbItsU7TDeBX2m+9ilNdXow=
 by: Tim Rentsch - Wed, 5 Apr 2023 16:20 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> writes:

> Lowell Gilbert <lgusenet@be-well.ilk.org> writes:

[earlier context]

>>>>>> "Catch-23: The New C Standard,Sets the World on Fire"
>>>>>> https://queue.acm.org/detail.cfm?id=3588242
>>>>>> [snip]
>>>>>
>> I think they're saying that before C17, realloc to a size of zero
>> was implementation defined, and that C17 changed that to it being
>> undefined. That isn't quite right, because it was
>> implementation-defined both before and after. But (I think; I
>> don't have a full copy of C17 at hand) the limitations were
>> changed, and realloc to a size of zero was explicitly described as
>> obsolescent. Unless I'm mistaken factually (possible, as I
>> mentioned) I think it's reasonable to consider C17 to be moving
>> towards disallowing the behaviour.
>
> I only have a draft of C17. The fact that C standards cost a lot of
> money is a valid point. I can't justify paying anything just to be
> able to chat on comp.lang.c about some finer points.
>
> The draft I have suggests that C17 just codified what implementation
> currently do: [...]

I think you can find the C17 information you're looking for by
looking at these two documents:

https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2464.pdf
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2438.htm

Pages:12345678
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor