[Issue 24381] New: ImportC: .di generator emits both forward declarations and definition
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Fri Feb  9 19:34:15 UTC 2024
    
    
  
https://issues.dlang.org/show_bug.cgi?id=24381
          Issue ID: 24381
           Summary: ImportC: .di generator emits both forward declarations
                    and definition
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ImportC
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dave287091 at gmail.com
C code:
struct foo;
struct foo {
    int x;
};
struct bar {
    int x;
};
struct bar;
emitted .di file:
extern(C)
{
        // ...
        struct foo;
        struct foo
        {
                int x = void;
        }
        struct bar
        {
                int x = void;
        }
        struct bar;
        // ...
}
Which leads to an error about conflicting structs.
--
    
    
More information about the Digitalmars-d-bugs
mailing list