[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] weird error message.
From: |
Harald van Dijk |
Subject: |
Re: [Tinycc-devel] weird error message. |
Date: |
Mon, 15 Jun 2009 19:35:18 +0200 |
User-agent: |
Mutt/1.5.19 (2009-01-05) |
On Mon, Jun 15, 2009 at 03:24:12PM +0800, Sam Watkins wrote:
> On Mon, Jun 15, 2009 at 04:17:17PM +0930, Daniel Burke wrote:
> > Personally I interpret that as meaning it's expecting an ; where it found
> > an =, although my C-fu is not strong enough to know if an extern
> > declaration and an assignment are allowed in one statement
>
> No you can't put an extern together with an initializer, extern means it
> is allocated and initialized elsewhere. [...]
extern together with an initialiser is valid so long as it is outside of
a function. In the original message it was inside one, but tcc doesn't
accept it otherwise either. I'm using tcc 0.9.24, I haven't checked if
this has since been fixed, but if not, this is a (minor) bug.
(C99 6.9.2p4 uses "extern int i3 = 3;" in an example, and 6.7.8p5
disallows it only at block scope.)