This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fdump-ast-original and strg:


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).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]