Geo Carncross geocar@internetconnection.net writes:
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.
- int len = strlen(passwd);
- ucs2le_t wpwd[len + 1];
Another C99ism.. Are there enough C99 compilers that it'd be good idea to require it? gcc of course works, but how about others?
No. gcc on debian woody (stable) requires --std=c99 to do it. Use alloca() if it's available (more widely so than C99) instead.
alloca() isn't really portable either, and having one OS use alloca() and another one malloc() with free() or similar isn't exactly going to aid debugging unfortunately.
-- Matthias Andree
Encrypted mail welcome: my GnuPG key ID is 0x052E7D95 (PGP/MIME preferred)