This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: fdump-ast-original and strg:
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