In article <[EMAIL PROTECTED]>, Luigi Rizzo <[EMAIL PROTECTED]> wrote: > On Tue, Oct 30, 2007 at 12:51:56PM +0000, Tony Mountifield wrote: > > Why would you want an element AFTER a zero-sized array? In the above > > example, pre[0] would occupy the same storage as a. > > > > Surely the zero-sized array is supposed to be the final item in the struct, > > so that the struct defines the fixed part and the array then identifies the > > beginning of the variable-length part. > > asterisk's stringfields > > http://svn.digium.com/view/asterisk/trunk/include/asterisk/stringfields.h?view=log > > are defined using macros, and the wrapper code (macro > AST_DECLARE_STRING_FIELDS() ) places a zero-size array as a marker > before the first element, and a zero-size array as a marker after > the last element. Macros then do pointer arithmetics using the > start marker.
OK, I see what you mean now. The zero-sized arrays are effectively acting just as labels. Thanks! Cheers Tony -- Tony Mountifield Work: [EMAIL PROTECTED] - http://www.softins.co.uk Play: [EMAIL PROTECTED] - http://tony.mountifield.org _______________________________________________ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
