[Dovecot] [PATCH 0/10] NTLM patchset submission
Timo Sirainen
tss at iki.fi
Sat Jul 31 07:03:13 EEST 2004
On 28.7.2004, at 01:51, Geo Carncross wrote:
> On Tue, 2004-07-27 at 17:36, Timo Sirainen wrote:
>> You use "char var[0]" in end of some structures. I've tried to avoid
>> them so far everywhere since C89 doesn't support it. But I guess it's
>> common enough feature that it could be allowed the way C99 supports
>> it,
>> var[].
>
> var[1] is safe and then malloc-1. Still C89-ok.
BTW. This works only as long as you don't care if sizeof() returns more
data than the structure actually uses. struct foo { int size; char
data[1]; }; sizeof(foo) == 8 with most compilers nowadays because of
alignmentation issues.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://dovecot.org/pipermail/dovecot/attachments/20040731/e5b46238/attachment-0001.bin>
More information about the dovecot
mailing list