Sujet : Re: Results of survey re. a new array size operator
De : jameskuyper (at) *nospam* alumni.caltech.edu (James Kuyper)
Groupes : comp.lang.cDate : 25. Jan 2025, 02:57:05
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vn1gdi$2g0m7$3@dont-email.me>
References : 1 2 3
User-Agent : Mozilla Thunderbird
On 1/24/25 18:13, Waldek Hebisch wrote:
James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
...
One of the most important goals of the C standard is backwards
compatibility. A lower case keyword would break any program that was
already using that keyword as a user-defined identifier.
>
Lower case _reserved word_ would break compatibility. But in most
cases there is no need to reserve a keyword: simply treat it as
predefined identifier with magic meaning. I user want gives it
different meaning, the new meaning would be used instead of
predefiend one.
Unless the syntax that contains the new keyword is such that a
user-defined identifier could never occur in the same location, I don't
see how that would work.
In this particular case, countof(array) certainly does NOT qualify. It's
meant to be used wherever an integer value for the length of the array
is needed. And in any such context, a user-named function returning an
integer value or a user-named macro expanding to an expression with an
integer value is also allowed (in some contexts, only the latter would
be a possibility).