From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Buck To: guillaume.thouvenin@polymtl.ca (Guillaume) Cc: gcc@gcc.gnu.org Subject: Re: fdump-ast-original and strg: Date: Thu, 29 Nov 2001 19:00:00 -0000 Message-ID: <200111300300.TAA05503@atrus.synopsys.com> References: X-SW-Source: 2001-11/msg01612.html Message-ID: <20011129190000.Lb2TmS0oz5Kr1TfqVztLudfRyItazr4oSiDemxjnfFo@z> Guillaume Thouvenin writes: ... > The problem is the following. If you have something like: > > -- part of a C code -- > > fprintf(stderr, "error strg: toto"); > > -- > > The asg given by gcc gives the following line: > > @247 string_cst type: @268 strg: error strg: toto lngt: 5 > > So, I add a very basic modification inside GCC (in c-dump.c) and now, it > produces this line: > > @247 string_cst type: @268 strg: "error strg: toto" lngt: 5 > > It is easier to parse. So, I'd like to know if it can be added to official > gcc futur release. It's only one line and for me it will be easier because > people won't need to recompile the gcc compiler if they want to use my > tool (ok for now I'm the only one who use it but it can change...). This seems reasonable, but does your patch do the whole job? What happens if the string contains newlines, control characters, or '"'? It would seem reasonable to make the output match the input (that is, output \", \n, etc).