Return-Path: Delivered-To: apmail-httpd-apreq-dev-archive@www.apache.org Received: (qmail 15274 invoked from network); 17 Feb 2005 04:45:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 17 Feb 2005 04:45:15 -0000 Received: (qmail 50436 invoked by uid 500); 17 Feb 2005 04:45:14 -0000 Delivered-To: apmail-httpd-apreq-dev-archive@httpd.apache.org Received: (qmail 50411 invoked by uid 500); 17 Feb 2005 04:45:14 -0000 Mailing-List: contact apreq-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list apreq-dev@httpd.apache.org Received: (qmail 50398 invoked by uid 99); 17 Feb 2005 04:45:14 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from theoryx5.uwinnipeg.ca (HELO theoryx5.uwinnipeg.ca) (142.132.65.108) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 16 Feb 2005 20:45:13 -0800 Received: from theoryx5.uwinnipeg.ca (localhost.localdomain [127.0.0.1]) by theoryx5.uwinnipeg.ca (8.12.8/8.12.8) with ESMTP id j1H4iHH3000704 for ; Wed, 16 Feb 2005 22:44:17 -0600 Received: from localhost (randy@localhost) by theoryx5.uwinnipeg.ca (8.12.8/8.12.8/Submit) with ESMTP id j1H4iHT1000700 for ; Wed, 16 Feb 2005 22:44:17 -0600 Date: Wed, 16 Feb 2005 22:44:17 -0600 (CST) From: Randy Kobes To: apreq-dev@httpd.apache.org Subject: Re: [multi-env] illegal escape sequence In-Reply-To: <873bvww8e8.fsf@gemini.sunstarsys.com> Message-ID: References: <87brakwtm5.fsf@gemini.sunstarsys.com> <873bvww8e8.fsf@gemini.sunstarsys.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Wed, 16 Feb 2005, Joe Schaefer wrote: > Joe Schaefer writes: > > [...] > > > Boggle: what happens when you feed that string to this macro: > > > > #define QUOTE_ME(foo) #foo > > const char bar[] = QUOTE_ME("rfc=out; Version=1; domain=\"example.com\""); > > > > K&R says this about #foo: > > The VC6 docs even include a similar example > > http://msdn.microsoft.com/library/default.asp? > url=/library/en-us/vccore98/html/_predir_stringizing_operator.asp > > > > Staring at the offending code in at.h, I can't > see what the problem might be here so I'll just > shut up now. I trust you guys will come up with > a good solution. :) Thanks for the pointers, Joe. I'm sure this problem must have come up in other contexts. For one thing, I found this suggestion (in a newsgroup) to use: #define QUOTE_ME_HELPER(foo) #foo #define QUOTE_ME(foo) QUOTE_ME_HELPER(foo) But using this or the one you suggested doesn't make a difference in the following. The following (which is similar to an example on the msdn site): int main(void) { const char bar[] = QUOTE_ME("domain=\"example.com"); printf("bar is %s\n", bar); return 0; } expands to int main(void) { const char bar[] = "\"domain=\\\"example.com\""; printf("bar is %s\n", bar); return 0; } which is OK. However int main(void) { const char bar[] = QUOTE_ME("domain=\"example.com\""); printf("bar is %s\n", bar); return 0; } expands to int main(void) { const char bar[] = "\"domain=\\\"example.com\\"\""; printf("bar is %s\n", bar); return 0; } which explains the "illegal escape sequence" error. This is with VC++ 6 (with gcc, both the above are fine). I'll keep looking for solutions ... -- best regards, randy