#139 __builtin_offsetof implementation

closed-accepted
Borut Ražem
None
5
2011-10-16
2009-06-04
Robert Larice
No

the current implementation of the offsetof macro
depends on special code in SDCCast.c
which causes problems for certain pointer casts.
(see offsetof-bug.c testcase in the patch)

this patch implements offsetof with a compiler
builtin __builtin_offsetof to avoid this problem,
and to avoid such special twisting of the ast.

Discussion

  • Robert Larice
    Robert Larice
    2009-06-04

    __builtin_offsetof implementation

     
  • Borut Ražem
    Borut Ražem
    2010-07-25

    Patch applied in svn revision #5888.

    Borut

     
  • Borut Ražem
    Borut Ražem
    2010-07-25

    • assigned_to: nobody --> borutr
    • status: open --> closed-accepted
     
  • Borut Ražem
    Borut Ražem
    2010-07-25

    The regression test offsetof-bug.c was not added due to the bug #3034400: cannot use generic pointer to initialize <null>. This bug remains open until #3034400 is added and the offsetof-bug.c regression test is added.

    Borut

     
  • Borut Ražem
    Borut Ražem
    2010-07-25

    • status: closed-accepted --> open-accepted
     
  • Borut Ražem
    Borut Ražem
    2011-10-16

    • status: open-accepted --> closed-accepted