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


Groups > comp.lang.c > #148134

Re: curiosity about compiler phases

Path csiph.com!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!feeder.erje.net!2.eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: curiosity about compiler phases
Date Fri, 22 Nov 2019 21:25:00 -0800
Organization None to speak of
Lines 29
Message-ID <ln8so7xiz7.fsf@kst-u.example.com> (permalink)
References <9585199f-546a-46f8-ac2a-de27cc08a3f5@googlegroups.com> <FcZBF.211$rX6.122@fx22.am4>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Injection-Info reader02.eternal-september.org; posting-host="dfad491d1778b0c95e43bf538d0f4f21"; logging-data="14872"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18KSbQ25SLBdlobZVrj09G+"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock sha1:JFIqzVryW6t0KdHIlgqlx8XrTlM= sha1:C77j9mthYHchVYspwbPEPhqKyN8=
Xref csiph.com comp.lang.c:148134

Show key headers only | View raw


Bart <bc@freeuk.com> writes:
[...]
> Every so often you come across crazy things that C allows in its 
> preprocessor; this is one of them. Not just being able to split up lines 
> between tokens, but even in the middle of tokens!

What you call crazy, I call simple.

Backslash-newline sequences are spliced in translation phase 2.
Preprocessing tokens aren't recognized until phase 3 (and
preprocessing tokens aren't converted into tokens until phase 7).
Of course a compiler isn't required to implement the 8 translation
phases explicitly, but a conforming compiler must behave as if
it did.

You've simply discovered another way in which it's possible to do
ugly things in C.  There is no language in which it isn't possible
to do ugly things.

"Doctor, my code is ugly when I do this!"

If your C compiler doesn't implement this as the standard requires,
then there could be standard-conforming C code that your compiler
can't handle.  To be clear, that doesn't bother me.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for Philips Healthcare
void Void(void) { Void(); } /* The recursive call of the void */

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


Thread

curiosity about compiler phases Thiago Adams <thiago.adams@gmail.com> - 2019-11-07 05:28 -0800
  Re: curiosity about compiler phases Nick Bowler <nbowler@draconx.ca> - 2019-11-22 19:25 +0000
  Re: curiosity about compiler phases "A. K." <minforth@arcor.de> - 2019-11-22 12:19 -0800
  Re: curiosity about compiler phases Bart <bc@freeuk.com> - 2019-11-22 22:22 +0000
    Typo? (Was: curiosity about compiler phases) gazelle@shell.xmission.com (Kenny McCormack) - 2019-11-22 22:34 +0000
      Re: Typo? (Was: curiosity about compiler phases) Bart <bc@freeuk.com> - 2019-11-22 23:49 +0000
        Re: Typo? Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2019-11-22 19:26 -0700
    Re: curiosity about compiler phases scott@slp53.sl.home (Scott Lurndal) - 2019-11-22 23:12 +0000
      Re: curiosity about compiler phases Bart <bc@freeuk.com> - 2019-11-23 00:06 +0000
        Re: curiosity about compiler phases Richard Damon <Richard@Damon-Family.org> - 2019-11-22 20:34 -0500
        Re: curiosity about compiler phases Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-11-23 01:47 +0000
          Re: curiosity about compiler phases Richard Damon <Richard@Damon-Family.org> - 2019-11-22 21:21 -0500
            Re: curiosity about compiler phases Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-11-24 03:26 +0000
              Re: curiosity about compiler phases Bart <bc@freeuk.com> - 2019-11-24 11:29 +0000
                Re: curiosity about compiler phases Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-11-24 16:49 +0000
          Re: curiosity about compiler phases Bart <bc@freeuk.com> - 2019-11-23 12:21 +0000
            Re: curiosity about compiler phases Richard Damon <Richard@Damon-Family.org> - 2019-11-23 10:08 -0500
            Re: curiosity about compiler phases scott@slp53.sl.home (Scott Lurndal) - 2019-11-23 15:49 +0000
              Re: curiosity about compiler phases Bart <bc@freeuk.com> - 2019-11-23 16:21 +0000
                Re: curiosity about compiler phases Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-11-24 03:37 +0000
                Re: curiosity about compiler phases Bart <bc@freeuk.com> - 2019-11-24 11:25 +0000
                Re: curiosity about compiler phases Bart <bc@freeuk.com> - 2019-11-25 14:06 +0000
    Re: curiosity about compiler phases Keith Thompson <kst-u@mib.org> - 2019-11-22 21:25 -0800
      Beyond our pay grade (Was: curiosity about compiler phases) gazelle@shell.xmission.com (Kenny McCormack) - 2019-11-23 07:43 +0000
    Re: curiosity about compiler phases Thiago Adams <thiago.adams@gmail.com> - 2019-11-23 06:28 -0800
      Re: curiosity about compiler phases Thiago Adams <thiago.adams@gmail.com> - 2019-11-23 06:39 -0800
      Re: curiosity about compiler phases Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2019-11-23 09:46 -0500
        Re: curiosity about compiler phases Richard Damon <Richard@Damon-Family.org> - 2019-11-23 10:16 -0500
      Re: curiosity about compiler phases Bart <bc@freeuk.com> - 2019-11-23 16:13 +0000
        Re: curiosity about compiler phases Thiago Adams <thiago.adams@gmail.com> - 2019-11-25 03:24 -0800
  Re: curiosity about compiler phases Bonita Montero <Bonita.Montero@gmail.com> - 2019-11-23 08:43 +0100

csiph-web