Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #167737

Re: Cake - C23 to C99 transpiler

From Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups comp.lang.c
Subject Re: Cake - C23 to C99 transpiler
Date 2022-09-15 23:46 -0700
Organization A noiseless patient Spider
Message-ID <86v8pnlst8.fsf@linuxsc.com> (permalink)
References (12 earlier) <8735d380ta.fsf@bsb.me.uk> <tfate1$r6$1@gioia.aioe.org> <87tu5ikivi.fsf@nosuchdomain.example.com> <86tu5am4a9.fsf@linuxsc.com> <87k065hm68.fsf@nosuchdomain.example.com>

Show all headers | View raw


Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>
>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>
>>> Bart <bc@freeuk.com> writes:
>>> [...]
>>>
>>>> Also, gcc gets away with allowing $ by default;  tcc generally copies
>>>> gcc in terms of how a compiler is invoked, so this surprisingly goes
>>>> against that.
>>>
>>> gcc allowing $ in identifiers is a documented extension for most
>>> targets, so it doesn't warn about them even with "-pedantic".  One could
>>> argue that this isn't necessarily an "extension", since "other
>>> implementation-defined characters" are explicitly permitted by C11
>>> 6.4.2.1.
>>>
>>> Interestingly, the C23 draft doesn't have that wording.  Instead, it
>>> allows XID_Start and XID_Continue characters, so it expands the set of
>>> characters that *all* implementations must support,
>>
>> I believe that conclusion is not correct.  The C23 draft n3047 says
>> this:
>>
>>     An XID_Start character is an implementation-defined character
>>     whose corresponding code point in ISO/IEC 10646 has the
>>     XID_Start property.  An XID_Continue character is an
>>     implementation-defined character whose corresponding code point
>>     in ISO/IEC 10646 has the XID_Continue property.
>>
>> The presence of the modifying adjective "implementation-defined" in
>> both cases surely means, at the very least, that implementations
>> are allowed to subset the Unicode-specified XID_Start/XID_Continue
>> sets with regard to what characters are allowed in identifiers.
>
> You're right.  I managed to miss the phrase "implementation-defined".
>
> So ISO/IEC 10646 defines which characters have the "XID_Start" property,
> but an "XID_Start" character is a member of a C implementation-defined
> subset of those characters.  The terminology is a bit confusing, but I'm
> not sure how I'd improve it.

I did not consider the question of how to improve the wording in
the ISO C standard.

>>> but doesn't permit '$' (assuming '$' isn't in XID_Start or
>>> XID_Continue).
>>
>> I'm not sure this statement is right either (and agreeing with the
>> assumption that '$' is not in XID_Start or XID_Continue).

To clarify my earlier statement, I am agreeing with (what I think
is your) assumption that '$'s ISO/IEC 10646 code point does not
have either the XID_Start property or the XID_Continue property.

>> The
>> Unicode reference documentation is so bad that I can't make out
>> with any degree of certainty whether it allows various domains to
>> extend the XID_Start/XID_Continue sets for the application in
>> question.  The presence of "implementation-defined" further muddies
>> the waters.  To be clear, neither am I saying that I think the
>> statement is wrong;  only that at present there is not enough
>> information to be confident of either conclusion.
>
> If '$' can't be an XID_Start or XID_Continue character, then an attempt
> to use '$' in an identifier is a syntax error.  I don't see any wiggle
> room there.  The open question is whether '$' is, or can be, an
> XID_Start or XID_Continue character.

Yes, I believe these statements are consistent with the most
natural reading of the current C23 draft (subject to a condition
that the consistency property can be objectively quantified).

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Cake -  C23 to C99 transpiler Thiago Adams <thiago.adams@gmail.com> - 2022-08-18 18:44 -0700
  Re: Cake - C23 to C99 transpiler Blue-Maned_Hawk <bluemanedhawk@example.invalid> - 2022-09-06 02:48 -0400
    Re: Cake - C23 to C99 transpiler Thiago Adams <thiago.adams@gmail.com> - 2022-09-06 10:08 -0700
      Re: Cake - C23 to C99 transpiler Vir Campestris <vir.campestris@invalid.invalid> - 2022-09-07 12:27 +0100
        Re: Cake - C23 to C99 transpiler Thiago Adams <thiago.adams@gmail.com> - 2022-09-07 05:45 -0700
          Re: Cake - C23 to C99 transpiler Bart <bc@freeuk.com> - 2022-09-07 15:35 +0100
            Re: Cake - C23 to C99 transpiler Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-09-07 16:38 +0100
              Re: Cake - C23 to C99 transpiler Bart <bc@freeuk.com> - 2022-09-07 17:04 +0100
                Re: Cake - C23 to C99 transpiler Anton Shepelev <anton.txt@g{oogle}mail.com> - 2022-09-07 19:14 +0300
                Re: Cake - C23 to C99 transpiler Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-09-07 17:31 +0100
                Re: Cake - C23 to C99 transpiler Bart <bc@freeuk.com> - 2022-09-07 17:40 +0100
                Re: Cake - C23 to C99 transpiler Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-09-07 17:49 +0100
                Re: Cake - C23 to C99 transpiler Bart <bc@freeuk.com> - 2022-09-07 19:27 +0100
                Re: Cake - C23 to C99 transpiler Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-09-07 20:02 +0100
                Re: Cake - C23 to C99 transpiler Bart <bc@freeuk.com> - 2022-09-07 21:03 +0100
                Re: Cake - C23 to C99 transpiler Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-09-07 13:52 -0700
                Re: Cake - C23 to C99 transpiler Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-09-14 07:14 -0700
                Re: Cake - C23 to C99 transpiler Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-09-14 10:59 -0700
                Re: Cake - C23 to C99 transpiler Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-09-15 23:46 -0700
                Re: Cake - C23 to C99 transpiler David Brown <david.brown@hesbynett.no> - 2022-09-07 20:17 +0200
                Re: Cake - C23 to C99 transpiler Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-09-07 19:58 +0100
                Re: Cake - C23 to C99 transpiler Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-09-07 13:26 -0700
                Re: Cake - C23 to C99 transpiler Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-09-07 23:42 +0100
                Re: Cake - C23 to C99 transpiler Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-09-14 06:45 -0700
                Re: Cake - C23 to C99 transpiler Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-09-14 06:40 -0700
                Re: Cake - C23 to C99 transpiler Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-09-07 10:28 -0700
                Re: Cake - C23 to C99 transpiler David Brown <david.brown@hesbynett.no> - 2022-09-07 20:05 +0200
            Re: Cake - C23 to C99 transpiler Thiago Adams <thiago.adams@gmail.com> - 2022-09-07 15:28 -0700
              Re: Cake - C23 to C99 transpiler Bart <bc@freeuk.com> - 2022-09-08 00:51 +0100
                Re: Cake - C23 to C99 transpiler Thiago Adams <thiago.adams@gmail.com> - 2022-09-08 05:20 -0700
                Re: Cake - C23 to C99 transpiler Bart <bc@freeuk.com> - 2022-09-08 16:41 +0100
                Re: Cake - C23 to C99 transpiler scott@slp53.sl.home (Scott Lurndal) - 2022-09-08 16:43 +0000
                Re: Cake - C23 to C99 transpiler Bart <bc@freeuk.com> - 2022-09-08 19:23 +0100
                Re: Cake - C23 to C99 transpiler Thiago Adams <thiago.adams@gmail.com> - 2022-09-08 09:59 -0700

csiph-web