On Mon, Feb 18, 2013 at 10:02 AM, erik quanstrom <quans...@quanstro.net>wrote:

> > No, the compiler is simply applying scope rules.  Without that inner
> > declaration explicitly overriding the outer declaration--whether
> > static or extern is used-- it will not compile (eg, if you put "static
> > void fn(Outer*);" or "extern void fn(Outer*);" and remove static from
> > fn in the file scope).
>
> since nested functions are not allowed, applying nested scope seems
> a bit odd.  anyway, ...
>

It's often to be refrained from even if it were extern and not static.


> if the declaration were in the same place but the referenced
> function were in another file, the -T would have prevented the
> link.  my question is, why doesn't the c compiler internally
> apply the same rule?
>

Wild guessing that it's probably an oversight that it got allowed.

-- 
Greg Comeau / 4.3.10.1 with C++0xisms now in beta!
Comeau C/C++ ONLINE ==>     http://www.comeaucomputing.com/tryitout
World Class Compilers:  Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?

Reply via email to