This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: The Manual on Extentions to the C Language Family
- To: hase at mech dot usp dot ac dot jp (Hideaki Hase)
- Subject: Re: The Manual on Extentions to the C Language Family
- From: Fergus Henderson <fjh at cs dot mu dot oz dot au>
- Date: Wed, 3 Jan 2001 19:43:00 +1100
- Cc: gcc at gcc dot gnu dot org
- References: <200101030541.OAA24082@edgar.mech.usp.ac.jp>
On 03-Jan-2001, Hideaki Hase <hase@mech.usp.ac.jp> wrote:
> In the 9th par. in "Nested Functions,"
> a nested function always has NO linkage, rather than internal one,
> doesn't it? An auto objects must have no linkage.
Yes.
However, it's not quite the same as the ordinary case of "no linkage",
since forward declarations are allowed. It's more like the case of
struct tags, for which there is a special exception:
| 6.7 Declarations
...
| [#3] If an identifier has no linkage, there shall be no more
| than one declaration of the identifier (in a declarator or
| type specifier) with the same scope and in the same name
| space, except for tags as specified in 6.7.2.3.
BTW, GNU C seems to allow nested functions to be declared `static', e.g.
typedef void (*funcptr)(void);
funcptr outer() {
static void inner2();
static void inner1() {
inner2();
}
static void inner2() {
/* ... */
}
inner1();
return inner2;
}
but the section on nested functions in the manual doesn't document
what this means.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.