Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 May 2005 07:26:13 +0200
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Craig Rodrigues <rodrigc@crodrigues.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: [GCC 4.0 PATCH] devfs_vnops.c 
Message-ID:  <3631.1117085173@critter.freebsd.dk>
In-Reply-To: Your message of "Thu, 26 May 2005 00:48:24 EDT." <20050526044824.GA81201@crodrigues.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20050526044824.GA81201@crodrigues.org>, Craig Rodrigues writes:

>"If, within a translation unit, the same identifier appears with both 
>internal and external linkage, the behavior is undefined."
>
>So, if you have:
>
>extern struct foo bar;
>static struct foo bar = { ..... };

Well, the reason is it like that is that you cannot forward
declare a static (at least in the -current GCC)

	static struct foo bar;
	[...]
	static struct foo bare = { ... };

This might be a bug in C.	

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3631.1117085173>