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 : ben (at) *nospam* bsb.me.uk (Ben Bacarisse)
Groupes : comp.lang.c
Date : 30. Jan 2025, 01:31:45
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87frl12lce.fsf@bsb.me.uk>
References : 1 2 3
User-Agent : Gnus/5.13 (Gnus v5.13)
David Brown <david.brown@hesbynett.no> writes:

On 29/01/2025 17:00, Ben Bacarisse wrote:
Alexis <flexibeast@gmail.com> writes:
 
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:
>
-- https://thephd.dev/the-big-array-size-survey-for-c-results
Curious.  The top objection to the usual macro solution is given as:
   * double-evaluation of e.g. getting the size of the 1-d part of a 2-d
     array int meow[3][4]; /* ... */ SIZE_KEYWORD(meow[first_idx()]);
Does the author not know that there is no evaluation of the operands of
sizeof in this example?
 
>
6.5.3.4p2 :
>
"""
If the type of the operand is a variable length array type, the operand is
evaluated; otherwise, the operand is not evaluated and the result is an
integer constant.
"""
>
I don't know if that is the source of the double-evaluation concern here,
but it is certainly a situation in which sizeof /does/ evaluate its
operand.

It would have been a good idea to pick an example that behaves as
claimed.  Let's hope this sort of casual approach is reserved for blogs.

--
Ben.

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