Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: C++ features for C Date: Sat, 12 May 2018 13:59:05 -0700 Organization: None to speak of Lines: 38 Message-ID: References: <11edbfd7-461d-4579-8ac7-a9e84a6b7630@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="b241fefa6b912bdefe83ae72b0e16b14"; logging-data="641"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/sZNdBjqbQde/b3nQ87LAf" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:baUK+sXWmgIaGX7t4vmx1qyYzAY= sha1:y7I1DPgcyX1V86yd3MdD9WU1WMo= Xref: csiph.com comp.lang.c:130470 supercat@casperkitty.com writes: > On Saturday, May 12, 2018 at 2:48:46 PM UTC-5, Keith Thompson wrote: >> Introducing trigraphs to the language marginally increased the >> language's complexity. At the time, their utility was thought to >> be worth that cost. Disabling them by default but adding a new >> feature to re-enable them would just add more complexity. > > Trigraphs are harmless outside string and character literals, but can > create trouble there. I don't see particular value in requiring that > compilers support trigraphs, but would see value in requiring that they > must by default treat > > "Are you crazy??" // " > > as a string literal which ends with two question marks. As a matter > of principle, I think that if a construct is defined by any version > of the Standard, it should be easy to write code that needs that > construct in a way that implementations would, at minimum, be allowed > to process it in the old fashion. Compilers *are* permitted to process programs in the old fashion, by operating in a non-conforming mode. As I mentioned, gcc already has a "-trigraphs" option, as well as "-std=cNN" (NN=90,99,11). I don't expect any of those options to go away if a new standard drops trigraphs. (I use gcc as an example; other compilers can do something similar.) And if nothing else, a filter that translates trigraphs would be nearly trivial to write and could be invoked as part of a build process if necessary. None of this requires keeping trigraph support in a future standard. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"