#145 Unable to reduce offsetof() to constant

closed-fixed
2
2013-05-25
2001-09-19
No

#define offsetof(TYPE, MEMBER) \ ((unsigned) &((TYPE *)0)->MEMBER)

struct STR
{
  char c1, c2;
};

foo()
{
  code int i = offsetof(struct STR, c2);
  return i;
}

SDCC: error *** Constant Expected Found Variable

Discussion

  • Erik Petrich

    Erik Petrich - 2003-09-14

    Logged In: YES
    user_id=635249

    Fixed in src/SDCCast.c 1.188

     
  • Erik Petrich

    Erik Petrich - 2003-09-14
    • milestone: --> fixed
    • assigned_to: nobody --> epetrich
    • status: open --> closed-fixed
     

Log in to post a comment.