[Issue 22625] New: importC: original name of typedef'd struct not visible in D when compiling separately

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 23 07:50:35 UTC 2021


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

          Issue ID: 22625
           Summary: importC: original name of typedef'd struct not visible
                    in D when compiling separately
           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

cmodule.c:
---
typedef struct data_s {
        int x;
} data_t;
---

dmodule.d:
---
import cmodule : data_s, data_t;
---

compile using "dmd -c dmodule.d" and get this:

  dmodule.d(1): Error: module `cmodule` import `data_s` not found, did you mean
alias `cmodule.data_t`?


if the C file is added to the command line like "dmd -c dmodule.d cmodule.c",
then the error goes away

version: DMD64 D Compiler v2.098.0-361-g415e58e6d

--


More information about the Digitalmars-d-bugs mailing list