From: Dario V. <dve...@el...> - 2001-05-05 18:43:54
|
Dear Sandeep, thanks for the trust but I'm not a compilers expert, just C/C++ programmer. Of course I will register at sourceforge.net and send you my UNIX ID but for the moment I prefere to "suggest" instead of "commit" so feel free to commit or not any of my suggestions (you and all other developers). Maybe you can give me a start point to understand the architecture of your big and great work (even if first two chapters of Aho Sethi Ullman are not sufficient to understand it.......). The best contribute I can give is in the direction of the end user, maybe developing some kind of IDE (M$ Windows only, sorry) that fully integrate sdcc. This can lead to gain more sdcc users and so more feedback for developers. It is funny to see that this mail exchange has discovered a similar bug in geocrawler mailing list system: if you go to http://www.geocrawler.com/lists/3/SourceForge/1557/0/ you can see how "\\" is converted to "\". Regards, Dario ---------------------------- Dario Vecchio e-mail: dve...@el... ---------------------------- At 10.15 05/05/01 -0700, you wrote: >Maybe you should have update permissions. If you want >you can register at sourceforge.net and let me know your >UNIX ID. >Sandeep > >-----Original Message----- >From: sdc...@li... >[mailto:sdc...@li...]On Behalf Of Dario >Vecchio >Sent: Saturday, May 05, 2001 10:15 AM >To: sdc...@li... >Subject: [sdcc-devel]Fix for problem with strings containing "\\". > > >This simple program doesn't compile (the assembler fails): > >------------------------------ >#include <stdio.h> > >void main (void) { > printf ("Hello \\"); >} >------------------------------ >sdcc -mds390 -IJ:\sdcc\include -LJ:\sdcc\lib\ds390 --xram-loc 0x100080 >--code-loc 0x10000 -Wl-r Hello390.c > >?ASxxxx-Error-<q> in line 445 of hello390.asm > <q> missing or improper operators, terminators, or delimiters >removing hello390.rel >------------------------------ > >The assembler asx8051 convert some 'C' escape sequence (aslex.c:301 >getmap()): > > \b, \f, \n, \r, \t, \\ and octal numbers like \123 > >Sdcc convert a string containing "\\" into: > > .ascii "\" > >and strings with other escape sequences (e.g. "\r\n") into: > > .db 0x0D > .db 0x0A > >The assembler fail with the line > > .ascii "\" > >and gives an error: > > "<q> missing or improper operators, terminators, or delimiters" > >So, there are 2 possibilities: > >1 - Fix sdcc converting "\\" into .db 0x5c > >2 - Fix sdcc leaving "\\" unconverted > >Choice 1 is easier to implement and make more sense in the whole context. > >NOTE: >in aslex.c:301 getmap() seems that "\\" is not accepted because >there isn't a case statement for it. >Looking carefully this function you can see that every unsupported >escape sequence like "\<any char>" return <any char> without error. >So "\\" return '\'. >For this reason the bug generate an assembler error just if "\\" is at >the end of the string. In all other cases simply eats '\' and returns >the character following. > >------------------------------------------------------ >FIX 1: SDCCglue.c:398 printChar() >------------------------------------------------------ >Change the line: > > if (*s < ' ' || *s == '\"') > >into: > > if (*s < ' ' || *s == '\"' || *s == '\\') >------------------------------------------------------ > >I hope this fix the problem. > >Regards, > >Dario Vecchio > >---------------------------- >Dario Vecchio >e-mail: dve...@el... >---------------------------- > > >_______________________________________________ >sdcc-devel mailing list >sdc...@li... >http://lists.sourceforge.net/lists/listinfo/sdcc-devel > > > > >_______________________________________________ >sdcc-devel mailing list >sdc...@li... >http://lists.sourceforge.net/lists/listinfo/sdcc-devel > |