Ar an chéad lá is fiche de mí Deireadh Fómhair, scríobh Stephen J. Turnbull:
[...] Is there an idiom for this that won't offend clang? Or
should I
turn off -Warray-bounds for clang?
http://mid.gmane.org/CAGy81L9XnQA91Y+SnCToqbfxX5TcC8yu07KDqHTZuTpUr9m6BA@...
suggests something like this, which we could add to compiler.h with the rest
of the cruft:
#if defined (__STDC_VERSION__) && (__STDC_VERSION__ > 199901)
#define FLEXIBLE_ARRAY
#else if GCC_VERSION
/* or some other condition, __has_feature or what have you */
#define FLEXIBLE_ARRAY 0
#else
#define FLEXIBLE_ARRAY 1
#endif
struct Buffer {
int len;
char bytes[FLEXIBLE_ARRAY];
};
Note that the implementation of the bit vectors also uses this technique.
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta