[Issue 22531] New: importC: D name mangling applied to forward declaration of function inside function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Nov 21 12:31:42 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=22531

          Issue ID: 22531
           Summary: importC: D name mangling applied to forward
                    declaration of function inside function
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: duser at airmail.cc

---
int main(void)
{
        void fn(void);
        fn();
        return 0;
}
void fn(void)
{
}
---

% dmd -run example.c
/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
example.o: in function `main':
example.c:(.text.main[main]+0x5): undefined reference to `_D2c14mainUZ2fnUZv'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1

similar bug from "possible duplicates":
https://issues.dlang.org/show_bug.cgi?id=15843

--


More information about the Digitalmars-d-bugs mailing list