[Dynamite] ANSI C question
Ian Holmes
ihh@fruitfly.org
Wed, 22 Mar 2000 17:39:20 -0800 (PST)
GLib uses casts to implement "private" data, e.g.
struct _GArray
{
gchar *data;
guint len;
};
in "glib.h", which is then casted to
struct _GRealArray
{
guint8 *data;
guint len;
guint alloc;
guint elt_size;
guint zero_terminated : 1;
guint clear : 1;
};
Do either of you know if this is strict ANSI, i.e. can we be sure that the
first two fields of _GArray (data & len) are mapped to the same memory
locations as data and len in _GRealArray in all C compilers?
If so it makes life a lot easier...
Ian
--
Ian Holmes .... Howard Hughes Medical Institute .... ihh@fruitfly.org