|
From: Markus H. <mar...@mh...> - 2008-11-27 21:57:16
|
Florian Forster writes: > I've just tried to compile libdbi with > ./configure --disable-docs \ > CFLAGS="-Wall -Werror" \ > CPPFLAGS="-D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=500" > an ran into problems with [v]asprintf: Since they're no in any standard, > Mac OS X (and therefore probably FreeBSD as well) will deactivate the > prototypes. I'll follow up on this.. > Just for the record: on FreeBSD 6.1 there are problems with snprintf, strcasecmp, and (v)asprintf using these flags. > Uh, I wouldn't use `-1' as an error indicator of type `size_t': `size_t' > is declared unsigned on many platforms, comparing it with `-1' will > cause warnings on many systems. Functions returning a memory size or a > negative error condition should use `ssize_t' (see read(2) for example). > Good point. Another case of careless code copying (tm). I've changed the function to return 0 in case of an error, as a buffer size of 0 is not going to do us any good. regards, Markus -- Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |