[Issue 22402] New: importC: Error: can't subtract '__tag2[1]' from pointer

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Oct 17 13:31:14 UTC 2021


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

          Issue ID: 22402
           Summary: importC: Error: can't subtract '__tag2[1]' from
                    pointer
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ibuclaw at gdcproject.org

---
typedef struct {
    short c;
} S1;

typedef struct {
    S1 *a;
    S1 b[1];
} S2;

int f1(S1 *a, S1 b[1])
{   
    return a - b;       // OK
}

int f2(S2 *s)
{ 
    return s->a - s->b; // Error
}

--


More information about the Digitalmars-d-bugs mailing list