[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] More on aliasing.

From: Anthony Carrico
Subject: Re: [Chicken-users] More on aliasing.
Date: Mon, 8 Jul 2002 10:00:50 -0400 (EDT)

On Mon, 8 Jul 2002, felix wrote:

> > Do you(felix) ever do anything where a C_word is holding the value of a
> void*
> > or something like that? like this:
> >
> > void *foo;
> > C_word i;
> >
> > i = (C_word)foo;
> >
> Yep, many times. Internally everything is handled with C_word objects,
> Also, the FFI does a lot of dirty casting between pointers and C_word's.

If you want this to work with the strict-aliasing optimization, you must

union foo_t
  void* ptr;
  C_word integer;

foo_t foo;

i = foo.integer;

  -Tony Carrico

reply via email to

[Prev in Thread] Current Thread [Next in Thread]