tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] TCC crashes on invalid structure reference


From: Mike
Subject: Re: [Tinycc-devel] TCC crashes on invalid structure reference
Date: Tue, 06 Nov 2007 17:30:44 -0500
User-agent: Thunderbird 2.0.0.6 (Windows/20070728)

Its strange that you got that strange error, and I got
"[Program Error--title] tcc.exe has generated errors and will be closed by Windows. You will need to restart the program. An error log is being created. [OK--button]". This is the generic program crash window.

Ok, here are more specifics on my computer (to recreate the solution). I have Windows 2000, SP4 plus other patches. I download and unpack "tcc-0.9.23.zip". Then I take the EXEs from the TCC folder and put them into the root of the "tcc-0.9.23" folder, so that TCC.EXE can find INCLUDE, LIB, etc.. I put crash.c into "tcc-0.9.23", then create a command window, CD to "tcc-0.9.23". Then, finally run "tcc crash.c" and I get the generic program crash window.

After looking in the event log, I find nothing added.

Marc Andre Tanner wrote:
Hi,

On Tue, Nov 06, 2007 at 01:53:27AM -0500, Mike wrote:
See the attached crash.c.  Compile with "tcc crash.c"

No crash here:
$> tcc crash.c
crash.c:12: ',' expected

Ok the error message doesn't really make sense. This is because within
parse_function_parameters() tcc trys to detect whether it parses an old
style K&R function definition or a modern prototype. This is done by
evaluating the return value of parse_btype() from the first parameter,
if no type is found then tcc assumes it deals with a K&R style function.

This is the case with your example, if you change it to the following:

void foo(int a /* correct 1st parameter */, invalid_type b){}

You get an appropriate error: invalid type. I don't have a solution right now.

Regards,
Marc





reply via email to

[Prev in Thread] Current Thread [Next in Thread]