News for hackers. Stuff that matters.
Re:Porting the Go compiler from C to Go by piokuc on Friday April 25, 2014 @05:36PM (#7649172)
That's why I said "not always". Here is an example which will print different result if you define

  #define union struct
Here you go:

  #include <stdio.h>
  union U { char a; char b; };

  int main() {
    U u;
    u.a = 13;
    u.b = 10;
    printf("%d\n", int(u.a));
    return 0;
  }
Re:Porting the Go compiler from C to Go by to3m on Friday April 25, 2014 @07:50PM (#7649812)
I don't think a and b need necessarily overlap. I think the types need to be more like this:

    struct A {char a;};
    struct B {char a;};
    union U {struct A a; struct B b;};