www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23187] New: importC: __builtin_offsetof still doesn't work


          Issue ID: 23187
           Summary: importC: __builtin_offsetof still doesn't work
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ryuukk.dev gmail.com

This was supposed to be fixed with PR:

But it still doesn't work

bar.c(8): Error: undefined identifier `__builtin_offsetof`

--- test.d
import std.stdio;
import c = bar;

void main()
    c.something s;

--- bar.c
typedef struct
    int offset;
} something;

void test(something* s)
    s->offset = __builtin_offsetof(something, a); 

Jun 14 2022