On 19 August 2012 10:34, Marco Leise <[email protected]> wrote:
> Am 19.08.2012, 10:25 Uhr, schrieb Iain Buclaw <[email protected]>:
>
>
>> You can only be certain that a function is never invoked unless it is
>> marked 'static' IMO.  My opinion is that it should warn you anyway, as
>> it is potentially buggy code, even if unused.
>
>
> What does static add to the mix?
>
> ---- b.d ----
> static foo() {
>     ...
> }
> ---- a.d ----
> import b;
> void main() {
>     foo();
> }
>
> Compiled as separate objects, b.foo can still be linked against.
>

I consider static functions local only to the current compilation
unit.  It is not a global/public decl that can have it's reference
pulled in from an external object / library.


-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';
_______________________________________________
dmd-internals mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-internals

Reply via email to