user data (was Re: [cairo] Patch improving fallbacks)

Jeremy Fitzhardinge jeremy at goop.org
Tue Feb 1 16:15:49 PST 2005


On Tue, 2005-02-01 at 11:42 -0500, mental at rydia.net wrote:
> > >  typedef struct {
> > >     int dummy;
> > >  } cairo_key_t;
> 
> Is the dummy member actually necessary?  IIRC an instance of an empty struct is
> still guaranteed to have a unique address.

Nope, Standard C prohibits 0-sized objects.  gcc allows them as an
extension.  You might be thinking of malloc(0), which can return either
NULL or a unique pointer.

	J




More information about the cairo mailing list