Guile Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Casting a pointer to a structure
Marius Vollmer <email@example.com> writes:
> struct env_funcs **ptr1 = ...;
> struct m *ptr2 = (struct m *)ptr1;
> Is this safe too? How can this be safely generalized to
> non-zero-offset members?
Yes it is. ANSI guarantees that a pointer to a structure
can be casted to a pointer to its first element and vice versa.
And I think this first element can also be a complex type (a structure
or union) but I am not sure.
Guile Home |
Main Index |