tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] struct member/typedefs share namespace?


From: Ben Hinkle
Subject: Re: [Tinycc-devel] struct member/typedefs share namespace?
Date: Tue, 18 Apr 2006 19:25:25 -0400



On 4/18/06, Toby Thain <address@hidden> wrote:

On 18-Apr-06, at 8:15 AM, Ben Hinkle wrote:

There's a bug in parse_btype. I noticed it, too, when I tried to compile fltk (I think that was it). I worked around it by adding a check after the default: label in parse_btype to goto the_end if type_found. Otherwise it keeps chewing up identifiers that are also typedefs.

 
Hmm,

 
That gets past the first problem but then breaks compilation in /usr/include/bits/types.h, at
__STD_TYPE __DEV_T_TYPE __dev_t;

 
But then maybe my fix wasn't exactly the same as your workaround. Starting from version 0.9.22 (Gentoo ebuild), at line 6639 (!) of tcc.c, in parse_btype() after the default: label, I changed 
if(typespec_found)
to 
if(type_found||typespec_found)
 
 
Ah. Here's what I currently have. Add a new flag typedef_found and replace the if condition you changed with (typedef_found || typespec_found). Set typedef_found before the break; of the default clause.

I haven't made any attempt to understand the context of this.

 
--Toby


On 4/17/06, Toby Thain <address@hidden> wrote:
Hi,

I was trying to build Bison 2.1 with various compilers, and found
that tcc (of all the compilers tested) had difficulties. (I used gcc
"-ansi -pedantic", icc v7.1 "-ansi" and lcc 4.2 without problems.)

The issue seems to be that bison has several structs with members
that have the same names as types, see e.g. the first occurrence at
src/symtab.h line 57.

Any comments? Is this worth fixing? I haven't checked any language
spec, but ANSI compilers seem to accept this in strict modes.

--Toby


_______________________________________________
Tinycc-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/tinycc-devel

_______________________________________________
Tinycc-devel mailing list

 

_______________________________________________
Tinycc-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/tinycc-devel




reply via email to

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