On Wed, Sep 28, 2005 at 09:36:02AM +0200, Sven Oliver Moll wrote:
>On Wed, 28 Sep 2005, PerfectDark wrote:
>
>>>>>Just try to compile (tcc -c) following file:
>>>>>
>>>>>//-------------------------------------------
>>>>>//begin
>>>>>void foo(SomethingUnknownType* x)
>>>>>{
>>>>>}
>>>>>//end
>>>>>//-------------------------------------------
>[...]
>>
>>May be all that bugs (see my next ask in list) because I use non-patched 
>>tcc (tcc-0.9.23), or windows version has something bug...
>>
>>Even though I could compile tcc by tcc and simple windows applications 
>>(GDI and console). Tcc crushes if it meet that code (see my question).
>>
>>If you know how I can fix it, tell me please.

Can you try the attached patch, please an let me know if it fixed that
particular thing?

thanks,
>>
>
>This seems to be a bug in tcc itself, not the Windows port. I ran it on a
>Linux system and got the following:
>
>$ gdb tcc-0.9.23/tcc
>GNU gdb 6.3
>[...]
>This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db 
>library "/lib/libthread_db.so.1".
>
>(gdb) run -c foo.c
>Starting program: /home/svolli/tcc/tcc-0.9.23/tcc -c foo.c
>
>Program received signal SIGSEGV, Segmentation fault.
>0x0804bc2f in sym_push (v=42, type=0x80804ac, r=498, c=12) at tcc.c:1766
>1766            s->prev_tok = *ps;
>(gdb) quit
>The program is running.  Exit anyway? (y or n) y
>$ cat foo.c
>void foo(unknown *x)
>{
>}
>
>I'd say that ps is NULL in this case, but that's a rough guess.
>Hope this helps.
>
>Greetings from Germany,
>SvOlli
>-- 
>|  _______       |
>| (  /\          | There's no feeling any greater
>|__)v\/lli a.k.a.| Than to shoot first and ask questions later
>|Sven Oliver Moll|   -- "Weird Al" Yankovic, "Trigger Happy"
>
>
>_______________________________________________
>Tinycc-devel mailing list
>[email protected]
>http://lists.nongnu.org/mailman/listinfo/tinycc-devel
>
diff -rup tinycc.oorig/tcc.c tinycc.tmp/tcc.c
--- tinycc.oorig/tcc.c  2005-09-05 23:04:12.000000000 +0200
+++ tinycc.tmp/tcc.c    2005-09-28 20:38:40.000000000 +0200
@@ -1452,7 +1452,8 @@ void warning(const char *fmt, ...)
 void skip(int c)
 {
     if (tok != c)
-        error("'%c' expected", c);
+        error("syntax error before %c token. '%c' expected but saw \"%s\"",
+              tok, c, tokcstr.data);
     next();
 }
 
_______________________________________________
Tinycc-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to