Summary: extern() in a function signature
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD

--- Comment #0 from 2011-10-01 17:22:06 PDT ---
This comes from code shown in D.learn:

You can't use extern(C) in a function signature:

void foo(extern(C) void function() f) {}
void main() {}

DMD 2.056head gives:

test.d(1): basic type expected, not extern
test.d(1): found 'extern' when expecting ')'
test.d(1): semicolon expected following function declaration
test.d(1): Declaration expected, not '('

Workaround: before the function definition you have to define the argument type
with an alias:

alias extern(C) void function() CF;
void foo(CF f) {}
void main() {}

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to