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: Marc Andre Tanner
Subject: Re: [Tinycc-devel] TCC crashes on invalid structure reference
Date: Tue, 6 Nov 2007 23:04:20 +0100
User-agent: Mutt/1.5.17 (2007-11-01)

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

-- 
 Marc Andre Tanner >< http://www.brain-dump.org/ >< GPG key: CF7D56C0




reply via email to

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