From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zack Weinberg To: Florian Krohm Cc: Guillaume , Joe Buck , gcc@gcc.gnu.org Subject: Re: fdump-ast-original and strg: Date: Fri, 30 Nov 2001 10:26:00 -0000 Message-ID: <20011130102600.A20309@codesourcery.com> References: <01113013120701.01459@warp9.fishkill.ibm.com> X-SW-Source: 2001-11/msg01632.html Message-ID: <20011130102600.vIPO1AKTgvjucffYO8GOi9Lj8H_JFlVuo_VafOHvIPE@z> On Fri, Nov 30, 2001 at 01:12:07PM -0500, Florian Krohm wrote: > I'm afraid, things are even a bit more complex. > Consider a string containing two characters, the first > of which contains the bit pattern 00001010. The second > character is '2'. If you want to recover the original > representation for that string you will have to use a > string concatenation e.g. "\12" "2" or "\x6" "2". I think you meant "\xa" "2". > Note that you cannot write "\122" as that would specify > only a single character. > You could call this a pathological example, but I think > you want to come up with an algorithm that can handle > the general case. "\0122" will work fine. (Or, in this case, "\n2" assuming ASCII.) We already have code to emit strings safely, into the assembly output; you could just use that. zw