comparison m4/flexmember.m4 @ 7617:e35875ded92b

* m4/flexmember.m4 (AC_C_FLEXIBLE_ARRAY_MEMBER): Mention that offsetof should be used instead of sizeof. From Bruno Haible.
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 07 Nov 2006 17:20:07 +0000
parents e856370de785
children 81bd0d34cbbe
comparison
equal deleted inserted replaced
7616:4e434249c068 7617:e35875ded92b
39 if test $ac_cv_c_flexmember = yes; then 39 if test $ac_cv_c_flexmember = yes; then
40 AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [], 40 AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [],
41 [Define to nothing if C supports flexible array members, and to 41 [Define to nothing if C supports flexible array members, and to
42 1 if it does not. That way, with a declaration like `struct s 42 1 if it does not. That way, with a declaration like `struct s
43 { int n; double d@<:@FLEXIBLE_ARRAY_MEMBER@:>@; };', the struct hack 43 { int n; double d@<:@FLEXIBLE_ARRAY_MEMBER@:>@; };', the struct hack
44 can be used with pre-C99 compilers.]) 44 can be used with pre-C99 compilers.
45 When computing the size of such an object, don't use 'sizeof (struct s)'
46 as it overestimates the size. Use 'offsetof (struct s, d)' instead.
47 Don't use 'offsetof (struct s, d@<:@0@:>@)', as this doesn't work with
48 MSVC and with C++ compilers.])
45 else 49 else
46 AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], 1) 50 AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], 1)
47 fi 51 fi
48 ]) 52 ])