offsetof: what sort of structure-members are allowed

Alan Myrvold ajmyrvold at violet.waterloo.edu
Sat Oct 21 05:52:36 AEST 1989


I hope that someone could clarify my fuzzification. Consider
the structure :

struct S {
   union {
      long i;
      struct {int i; int j; } b;
   } u;
} s;

According to the draft ANSI standard, can the second argument of
offsetof be as complicated as I like, e.g. is

   offsetof(struct S,u.b.j)               allowed ??? always ???

-------------------------------------------------------------------
Alan Myrvold     ajmyrvold at violet.waterloo.edu
-------------------------------------------------------------------



More information about the Comp.std.c mailing list