[PD] t_scalar member sc_vec

Jonathan Wilkes jancsika at yahoo.com
Fri Feb 21 03:32:48 CET 2014


Can anyone explain what's going on with this in m_pd.h:

typedef struct _scalar      /* a graphical object holding data */
{
    t_gobj sc_gobj;         /* header for graphical object */
    t_symbol *sc_template;  /* template name (LATER replace with pointer) */
    t_word sc_vec[1];       /* indeterminate-length array of words */
} t_scalar;

How is a static t_word array of size 1 an indeterminate-length array?  Is its placement as the last member of the struct required?

I see lots of mysterious casts in the internals of Pd's data structures.  What's the trick here, and is it documented anywhere on the interwebs, a C standard doc, etc.?

Thanks,
Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20140220/012e79ba/attachment.htm>


More information about the Pd-list mailing list