This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: (extern int vs. int) and (extern function vs. function) (was: gcc-in-cxx update)
- From: Eus <reply dot to dot eus dot at dot member dot fsf dot org at gmail dot com>
- To: James Dennett <james dot dennett at gmail dot com>
- Cc: Ian Lance Taylor <iant at google dot com>, eus at member dot fsf dot org, "Joseph S. Myers" <joseph at codesourcery dot com>, Manuel López-Ibáñez <lopezibanez at gmail dot com>, gcc at gcc dot gnu dot org
- Date: Fri, 01 May 2009 09:07:18 +0700
- Subject: Re: (extern int vs. int) and (extern function vs. function) (was: gcc-in-cxx update)
- References: <m3hc0729jr.fsf@google.com> <Pine.LNX.4.64.0904291120200.23778@digraph.polyomino.org.uk> <6c33472e0904290513j44b3cafdl77b38de0cd2619cd@mail.gmail.com> <Pine.LNX.4.64.0904291321570.25453@digraph.polyomino.org.uk> <6c33472e0904290642j4b243ba3u4ec76b71b0c0e410@mail.gmail.com> <Pine.LNX.4.64.0904291456280.27093@digraph.polyomino.org.uk> <6c33472e0904290819o3b0dafd4s750be6543484dabe@mail.gmail.com> <Pine.LNX.4.64.0904291537250.27093@digraph.polyomino.org.uk> <1241092470.6783.20.camel@eus-laptop> <m3ocuet1e1.fsf@google.com> <18738acb0904301240p5a989bfcr2330af684c9a9bf1@mail.gmail.com>
- Reply-to: eus at member dot fsf dot org
Hi Ho!
On Thu, 2009-04-30 at 12:40 -0700, James Dennett wrote:
> [I imagine Ian is aware of this anywyay, but to try to clarify...]
>
> At file scope, "int i;" with no initializer is a "tentative
> definition" in C, see 6.9.2/2; a tentative definition is an odd beast
> that works in some ways rather unlike other definitions (e.g., it's
> perfectly valid to have multiple tentative definitions for the same
> variable in the same file). Informally (only) it seems fair to say
> that a tentative definition is "treated as a declaration only". If
> you want precision though, such fudging isn't helpful.
Yup, I am aware of this.
> C++ does not have the concept of a tentative declaration:
> int i;
> int i; // legal in C99, invalid as a duplicate definition in C++03
>
> To me that's amusing when compared to:
> typedef int j;
> typedef int j; // legal in C++03, invalid as a duplication definition in C99
Heh, that's strange ;-)
Thanks for your further clarification :-)
> -- James
--
Best regards,
Eus (FSF member #4445)
In this digital era, where computing technology is pervasive, your
freedom depends on the software controlling those computing devices.
Join free software movement today! It is free as in freedom, not as in
free beer!
Join: http://www.fsf.org/jf?referrer=4445