Path: csiph.com!news.mixmin.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c Subject: Re: Cake - C23 to C99 transpiler Date: Wed, 14 Sep 2022 06:40:12 -0700 Organization: A noiseless patient Spider Lines: 28 Message-ID: <8635cunkg3.fsf@linuxsc.com> References: <836c6515-87f5-42b2-98b0-8308173a9120n@googlegroups.com> <8735d39ou5.fsf@bsb.me.uk> <87leqv87t2.fsf@bsb.me.uk> <878rmv810h.fsf@bsb.me.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader01.eternal-september.org; posting-host="e4a07c6eb40a7dcf36ed28254bbf399a"; logging-data="3128046"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/j0WbHwZN7m7f8diTe6amWW7ujPrtAQWM=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:QC3rV+t9DS5k+sR5jtGvaXVd7nw= sha1:DYJWghg2+GSwFrddijzZHRfD8Ck= Xref: csiph.com comp.lang.c:167708 Ben Bacarisse writes: > David Brown writes: > >> I believe (but I might have this wrong) that the use of dollar signs >> in identifiers is undefined behaviour according to the standard. > > I don't think it's undefined. Recent C drafts permit "other > implementation defined characters" in the syntax, so I'm not sure how it > could be undefined. If the implementation's documentation lists dollar sign amoung the set of implementation-defined characters for identifiers, the behavior is defined. Otherwise, the presence of dollar sign (in source that hasn't been filtered out by preprocessor directives) results in a syntax error, which makes the behavior undefined. > The C23 draft permits an XID_Start character followed by XID_Continue > characters. These may, in fact, include $ but I got lost down the > rabbit hole of referenced standards so I can't be sure. Looking at some Unicode reference material and also looking at some web search results, the evidence seems pretty strong that $ and @ are not included in the XID_Start and XID_Continue default sets. However, it isn't clear (at least it isn't to me) whether the C23 draft admits the possibility that $ and @ may be accepted under an implementation-defined umbrella.