tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] typedef bug in version 0.9.22


From: Dave Dodge
Subject: Re: [Tinycc-devel] typedef bug in version 0.9.22
Date: Thu, 6 Jan 2005 02:39:40 -0500
User-agent: Mutt/1.4.2i

On Wed, Jan 05, 2005 at 01:48:07PM +0000, Julian Brown wrote:
> address@hidden:~$ cat > f.c
> typedef int a;
> typedef int b;
> b a;
> address@hidden:~$ gcc f.c
> f.c:3: error: `a' redeclared as different kind of symbol
> f.c:1: error: previous declaration of `a'
> 
> I think this is expected behaviour, isn't it?

N869 (C99 draft) 6.7.7 says that typedef names "share the same name
space as other other identifiers declared in ordinary declarators".
So it makes sense that the compiler sees this as an attempt to use the
identifier "a" in two different ways in the same scope.

However, _this_ should work:

  typedef int a;
  typedef int b;
  void foo(void){ b a; }

gcc does accept that, but tcc 0.9.22 does not.  I haven't tried
tcc CVS.

                                                  -Dave Dodge




reply via email to

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