Re: Results of survey re. a new array size operator

Liste des GroupesRevenir à cl c 
Sujet : Re: Results of survey re. a new array size operator
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.c
Date : 24. Jan 2025, 20:45:21
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250124113853.6@kylheku.com>
References : 1
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2025-01-24, Alexis <flexibeast@gmail.com> wrote:
>
Hi all,
>
JeanHeyd Meneide, a Project Editor for WG14, has just posted the results
of a survey re. the preferred form of a new array size operator:
>
"There is a clear preference for a lowercase keyword, here, though it is
not by the biggest margin. One would imagine that with the way we keep
standardizing things since C89 (starting with _Keyword and then adding a
header with a macro) that C folks would be overwhelmingly in favor of
simply continuing that style. The graph here, however, tells a different
story: while there’s a large contingency that clearly hates having
_Keyword by itself, it’s not the _Keyword + stdkeyword.h macro that
comes out on top! It’s just having a plain lowercase keyword, instead."

The best way to have versioning for this in a C compiler is a
language dialect selection option.  Say that C27 (or whatever year)
adds an "arraysize" keyword.

- To use that keyword in the updated gcc, you use -std=c27.

- To compile programs written for C99, use -std=c99. Those
  programs can use arraysize as an identifier.

- To move those programs to C27, you fix all the uses of
  that identifier.

I don't see why we need _Keyword cruft with a header which provides
a macro alias, when compilers not only can have dialect selection
options but realistically cannot avoid doing so.

I hope the propsed array size keyword raises a constraint violation when
applied to a non-array. GCC had to develop a diagnostic for when sizeof
ptr is divided by sizeof ptr[0]!

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Date Sujet#  Auteur
24 Jan 25 * Results of survey re. a new array size operator36Alexis
24 Jan 25 +* Re: Results of survey re. a new array size operator10Michael S
24 Jan 25 i`* Re: Results of survey re. a new array size operator9Kaz Kylheku
25 Jan 25 i `* Re: Results of survey re. a new array size operator8Kaz Kylheku
29 Jan 25 i  `* Re: Results of survey re. a new array size operator7Tim Rentsch
29 Jan 25 i   `* Re: Results of survey re. a new array size operator6bart
29 Jan 25 i    +- Re: Results of survey re. a new array size operator1Michael S
29 Jan 25 i    +* Re: Results of survey re. a new array size operator2Richard Damon
29 Jan 25 i    i`- Re: Results of survey re. a new array size operator1Tim Rentsch
29 Jan 25 i    +- Re: Results of survey re. a new array size operator1James Kuyper
29 Jan 25 i    `- Re: Results of survey re. a new array size operator1Tim Rentsch
24 Jan 25 +* Re: Results of survey re. a new array size operator13James Kuyper
24 Jan 25 i+* Re: Results of survey re. a new array size operator5Kaz Kylheku
25 Jan 25 ii+* Re: Results of survey re. a new array size operator3James Kuyper
25 Jan 25 iii`* Re: Results of survey re. a new array size operator2Kaz Kylheku
25 Jan 25 iii `- Re: Results of survey re. a new array size operator1James Kuyper
29 Jan 25 ii`- Re: Results of survey re. a new array size operator1Tim Rentsch
25 Jan 25 i`* Re: Results of survey re. a new array size operator7Waldek Hebisch
25 Jan 25 i +- Re: Results of survey re. a new array size operator1Kaz Kylheku
25 Jan 25 i `* Re: Results of survey re. a new array size operator5James Kuyper
25 Jan 25 i  `* Re: Results of survey re. a new array size operator4Waldek Hebisch
26 Jan 25 i   `* Re: Results of survey re. a new array size operator3Keith Thompson
26 Jan 25 i    +- Re: Results of survey re. a new array size operator1Waldek Hebisch
29 Jan 25 i    `- Re: Results of survey re. a new array size operator1Tim Rentsch
24 Jan 25 +* Re: Results of survey re. a new array size operator4Kaz Kylheku
24 Jan 25 i+* Re: Results of survey re. a new array size operator2Alexis
25 Jan 25 ii`- Re: Results of survey re. a new array size operator1Kaz Kylheku
29 Jan 25 i`- Re: Results of survey re. a new array size operator1Tim Rentsch
29 Jan 25 +- Re: Results of survey re. a new array size operator1Tim Rentsch
29 Jan 25 `* Re: Results of survey re. a new array size operator7Ben Bacarisse
29 Jan 25  `* Re: Results of survey re. a new array size operator6David Brown
30 Jan 25   `* Re: Results of survey re. a new array size operator5Ben Bacarisse
30 Jan 25    +- Re: Results of survey re. a new array size operator1David Brown
30 Jan 25    `* Re: Results of survey re. a new array size operator3Tim Rentsch
30 Jan 25     +- Re: Results of survey re. a new array size operator1Kaz Kylheku
19 Feb 25     `- Re: Results of survey re. a new array size operator1Tim Rentsch

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal