[haiku-development] Re: Disabling Strict Aliasing for GCC4 Builds

  • From: "Alex Roman" <alex.roman@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 17 Apr 2008 15:33:46 -0700

On 17/04/2008, Alex Roman <alex.roman@xxxxxxxxx> wrote:
>  int xxx;
>
>  typedef union {
>   int x;
>   float y;
>  } test;
>
>  ...
>
>  test * t = (test *)x;
>
>  x = t->x;
>  float y = t->y;

Sorry, the correct code is:

typedef union {
  int x;
  float y;
} test;

...

int xxx = 3;

test * t = (test *)xxx;

int x = t->x;
float y = t->y;


Cheers!
-- 
Alex Roman <alex.roman@xxxxxxxxx>

Other related posts: