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


Groups > comp.lang.c > #16603

Re: trigraphs, yecch

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!novia!news-out.readnews.com!news-xxxfer.readnews.com!s09-10.readnews.com!not-for-mail
From Patrick Scheible <kkt@zipcon.net>
Newsgroups comp.lang.c
Subject Re: trigraphs, yecch
References <4f2808f4.648026530@text.giganews.com> <ln4nvbxxkb.fsf@nuthaus.mib.org> <86aa53e59d.fsf@zipcon.net> <jgak72$s1u$1@dont-email.me>
Date Wed, 01 Feb 2012 11:12:54 -0800
Message-ID <8662fqtljd.fsf@zipcon.net> (permalink)
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (berkeley-unix)
Cancel-Lock sha1:LpD9n8Q7SXKW+9/A2uuw0lAPIS0=
MIME-Version 1.0
Content-Type text/plain
Lines 54
Organization The Zip Connection (zipcon.net)
NNTP-Posting-Host b6ca6417.news.zipcon.net
X-Trace DXC=<<=dMIE[]\g\ReMM7bl69fU>Dm5d6:E6mYVOId^O@nFf;:7LAL_EVZi_A>1gcoFWomfGGV:eDDfae
X-Complaints-To abuse@zipcon.net
Xref x330-a1.tempe.blueboxinc.net comp.lang.c:16603

Show key headers only | View raw


"Charles Richmond" <netnews@aquaporin4.com> writes:

> "Patrick Scheible" <kkt@zipcon.net> wrote in message
> news:86aa53e59d.fsf@zipcon.net...
>> Keith Thompson <kst-u@mib.org> writes:
>>
>>> cri@tiac.net (Richard Harter) writes:
>>>> The other day I wanted to put three successive question marks in a
>>>> string.  Frex, "(???).%s.%s".  My trusty antique gcc compiler
>>>> converted the last two '?'s into a ']' along with a warning that it
>>>> was doing a trigraph conversion.
>>>>
>>>> Now, me, I know from nothing about trigraphs - never used them, hope
>>>> never to use them - so I was caught by surprise.  My elderly copy of
>>>> K&R described them but I didn't see anything about getting around
>>>> them.
>>>>
>>>> So.  How is one supposed to get three successive question marks into a
>>>> string?
>>>
>>> For reference, there are exactly 9 trigraphs.  C99 5.2.1.1:
>>>
>>>     All occurrences in a source file of the following sequences of three
>>>     characters (called trigraph sequences) are replaced with the
>>>     corresponding single character.
>>>
>>>         ??= #     ??) ]    ??! |
>>>         ??( [     ??' ^    ??> }
>>>         ??/ \     ??< {    ??- ~
>>>
>>>     No other trigraph sequences exist. Each ? that does not begin one of
>>>     the trigraphs listed above is not changed.
>>>
>>> In your case, "???" is not a trigraph, but ??) is.
>>
>> Has the C standards committee been flamed enough for trigraphs?  I don't
>> think so.  I bet there's 1000 programmers bitten by them for every 1
>> who's been helped.  By 1989 anyone who didn't have an editor capable of
>> typing any 7-bit ASCII character was a hopeless luddite who would be
>> better served making their own pre-preprocessing phase for C and leaving
>> the language unchanged instead of another phase in the preprocessor for
>> every C program forever and ever.
>>
>
> So just *remove* trigraphs from the *next* C standard.  Or require the
> preprocessor symbol "__TRIGRAPH_IMPLEMENTED__" to be defined, or
> relegate this to a PRAGMA...  before trigraphs would be recognized by
> the compiler. Make it *extra* hard for the ordinary C programmer to
> step on this land mine.

Yes, this is the best thing to do now, since it's to late to have never
put them in the language in the first place.

-- Patrick

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


Thread

trigraphs, yecch cri@tiac.net (Richard Harter) - 2012-01-31 15:55 +0000
  Re: trigraphs, yecch pete <pfiland@mindspring.com> - 2012-01-31 11:05 -0500
    Re: trigraphs, yecch Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-01-31 16:47 +0000
      Re: trigraphs, yecch cri@tiac.net (Richard Harter) - 2012-01-31 17:21 +0000
        Re: trigraphs, yecch James Kuyper <jameskuyper@verizon.net> - 2012-01-31 12:26 -0500
        Re: trigraphs, yecch Robert Wessel <robertwessel2@yahoo.com> - 2012-01-31 11:40 -0600
          Re: trigraphs, yecch Keith Thompson <kst-u@mib.org> - 2012-01-31 15:22 -0800
            Re: trigraphs, yecch "BartC" <bc@freeuk.com> - 2012-02-01 01:09 +0000
              Re: trigraphs, yecch James Kuyper <jameskuyper@verizon.net> - 2012-01-31 22:21 -0500
              Re: trigraphs, yecch Keith Thompson <kst-u@mib.org> - 2012-01-31 21:25 -0800
            Re: trigraphs, yecch "Charles Richmond" <netnews@aquaporin4.com> - 2012-01-31 23:40 -0600
              Re: trigraphs, yecch Keith Thompson <kst-u@mib.org> - 2012-01-31 22:19 -0800
                Re: trigraphs, yecch James Kuyper <jameskuyper@verizon.net> - 2012-02-01 08:27 -0500
        Re: trigraphs, yecch Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-01-31 17:47 +0000
        Re: trigraphs, yecch ImpalerCore <jadill33@gmail.com> - 2012-01-31 09:41 -0800
        Re: trigraphs, yecch pete <pfiland@mindspring.com> - 2012-01-31 13:17 -0500
  Re: trigraphs, yecch blp@cs.stanford.edu (Ben Pfaff) - 2012-01-31 09:56 -0800
  Re: trigraphs, yecch Peter Nilsson <airia@acay.com.au> - 2012-01-31 13:55 -0800
    Re: trigraphs, yecch Harald van Dijk <haraldvdijk@gmail.com> - 2012-01-31 14:02 -0800
      Re: trigraphs, yecch blp@cs.stanford.edu (Ben Pfaff) - 2012-01-31 14:06 -0800
        Re: trigraphs, yecch Harald van Dijk <haraldvdijk@gmail.com> - 2012-01-31 15:13 -0800
        Re: trigraphs, yecch "Charles Richmond" <netnews@aquaporin4.com> - 2012-01-31 23:44 -0600
          Re: trigraphs, yecch Keith Thompson <kst-u@mib.org> - 2012-01-31 22:20 -0800
            Re: trigraphs, yecch James Harris <james.harris.1@googlemail.com> - 2012-01-31 22:56 -0800
              Re: trigraphs, yecch Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-02-01 12:15 +0000
  Re: trigraphs, yecch Keith Thompson <kst-u@mib.org> - 2012-01-31 15:27 -0800
    Re: trigraphs, yecch Patrick Scheible <kkt@zipcon.net> - 2012-01-31 17:01 -0800
      Re: trigraphs, yecch Keith Thompson <kst-u@mib.org> - 2012-01-31 19:50 -0800
        Re: trigraphs, yecch Patrick Scheible <kkt@zipcon.net> - 2012-02-01 10:31 -0800
      Re: trigraphs, yecch James Kuyper <jameskuyper@verizon.net> - 2012-01-31 23:17 -0500
        Re: trigraphs, yecch "Joachim Schmitz" <nospam.jojo@schmitz-digital.de> - 2012-02-01 10:39 +0100
        Re: trigraphs, yecch Kaz Kylheku <kaz@kylheku.com> - 2012-02-01 17:20 +0000
        Re: trigraphs, yecch Patrick Scheible <kkt@zipcon.net> - 2012-02-01 11:11 -0800
      Re: trigraphs, yecch "Charles Richmond" <netnews@aquaporin4.com> - 2012-01-31 23:50 -0600
        Re: trigraphs, yecch ralph <nt_consulting64@yahoo.net> - 2012-02-01 11:56 -0600
        Re: trigraphs, yecch Patrick Scheible <kkt@zipcon.net> - 2012-02-01 11:12 -0800
        Re: trigraphs, yecch Stephen Sprunk <stephen@sprunk.org> - 2012-02-01 13:29 -0600
          Re: trigraphs, yecch blp@cs.stanford.edu (Ben Pfaff) - 2012-02-01 11:35 -0800
            Re: trigraphs, yecch Kaz Kylheku <kaz@kylheku.com> - 2012-02-01 19:59 +0000
              Re: trigraphs, yecch blp@cs.stanford.edu (Ben Pfaff) - 2012-02-01 12:41 -0800
                Re: trigraphs, yecch Kaz Kylheku <kaz@kylheku.com> - 2012-02-01 22:55 +0000
            Re: trigraphs, yecch Stephen Sprunk <stephen@sprunk.org> - 2012-02-01 14:44 -0600
              Re: trigraphs, yecch Kaz Kylheku <kaz@kylheku.com> - 2012-02-01 22:55 +0000
        Re: trigraphs, yecch "christian.bau" <christian.bau@cbau.wanadoo.co.uk> - 2012-02-02 14:19 -0800
          Re: trigraphs, yecch Patrick Scheible <kkt@zipcon.net> - 2012-02-06 20:40 -0800
            Re: trigraphs, yecch "Joachim Schmitz" <nospam.jojo@schmitz-digital.de> - 2012-02-07 11:40 +0100
      Re: trigraphs, yecch jgk@panix.com (Joe keane) - 2012-02-02 14:15 +0000
  Re: trigraphs, yecch cri@tiac.net (Richard Harter) - 2012-02-01 16:52 +0000

csiph-web