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


Groups > comp.lang.c > #12904

Re: A variation of #

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From James Kuyper <jameskuyper@verizon.net>
Newsgroups comp.lang.c
Subject Re: A variation of #
Date Tue, 08 Nov 2011 12:15:38 -0500
Organization A noiseless patient Spider
Lines 32
Message-ID <4EB963BA.1020800@verizon.net> (permalink)
References <8f2cadb2-614d-4754-8bc3-bb7c063524ae@c16g2000pre.googlegroups.com> <9hqo41F4bgU2@mid.individual.net> <73822171-7a92-4420-9eea-e74bbeda1ff8@x28g2000prb.googlegroups.com> <4EB83A82.1080100@verizon.net> <v44mo8-lfm.ln1@jones.homeip.net> <e5604f05-1376-4a92-9c17-51cc92b3ff0b@d17g2000yql.googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
Injection-Info mx04.eternal-september.org; posting-host="2P71cupDoazVVolqpw1jrw"; logging-data="2266"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX197k2Sa+0HfSup5hVDnrQJHtGmIc/JGyoQ="
User-Agent Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.23) Gecko/20110920 Thunderbird/3.1.15
In-Reply-To <e5604f05-1376-4a92-9c17-51cc92b3ff0b@d17g2000yql.googlegroups.com>
Cancel-Lock sha1:n4lO7SoUF5UHV03NIYNYQ+DbERg=
Xref x330-a1.tempe.blueboxinc.net comp.lang.c:12904

Show key headers only | View raw


On 11/08/2011 12:01 PM, Harald van Dijk wrote:
> On Nov 7, 11:53 pm, lawrence.jo...@siemens.com wrote:
>> James Kuyper <jameskuy...@verizon.net> wrote:
>>> #include <stdlib.h>
>>> #define TRICAT(a, b, c) a ## b ## c
>>> #define CHAR(a, b, c) TRICAT(a, b, c)
>>
>>> #define CASE1 x
>>
>> ...
>>>     case CHAR('
>>>         , CASE1, '
>>>         ): break;
>>
>> Nice try, but no cigar.  The ## operator requires that the result be a
>> valid pp-token and, depending on the order in which the operators are
>> evaluated, you either end up with 'x or x', neither of which are valid
>> pp-tokens.
> 
> Even if ## were redefined so that intermediate results of a ## b ## c
> are ignored, the behaviour is explicitly undefined.
> 
> 6.4:
> preprocessing-token:
>   [...]
>   each non-white-space character that cannot be one of the above
> 
> 6.4p3:
> If a ' or a " character matches the last category, the behavior is
> undefined.

Yes, I forgot about that item, too.

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


Thread

A variation of # Andrey Vul <andrey.vul@gmail.com> - 2011-11-07 10:53 -0800
  Re: A variation of # Ian Collins <ian-news@hotmail.com> - 2011-11-08 07:59 +1300
    Re: A variation of # Andrey Vul <andrey.vul@gmail.com> - 2011-11-07 11:11 -0800
      Re: A variation of # James Kuyper <jameskuyper@verizon.net> - 2011-11-07 15:07 -0500
        Re: A variation of # lawrence.jones@siemens.com - 2011-11-07 17:53 -0500
          Re: A variation of # James Kuyper <jameskuyper@verizon.net> - 2011-11-07 18:31 -0500
            Re: A variation of # lawrence.jones@siemens.com - 2011-11-08 09:16 -0500
          Re: A variation of # Thad Smith <ThadSmith@acm.org> - 2011-11-07 19:51 -0700
          Re: A variation of # Harald van Dijk <truedfx@gmail.com> - 2011-11-08 09:01 -0800
            Re: A variation of # James Kuyper <jameskuyper@verizon.net> - 2011-11-08 12:15 -0500
        Re: A variation of # Andrey Vul <andrey.vul@gmail.com> - 2011-11-07 17:32 -0800
          Re: A variation of # James Kuyper <jameskuyper@verizon.net> - 2011-11-07 21:17 -0500
    Re: A variation of # Andrey Vul <andrey.vul@gmail.com> - 2011-11-07 11:08 -0800
  Re: A variation of # Peter Nilsson <airia@acay.com.au> - 2011-11-07 16:46 -0800

csiph-web