eocene wrote:
Jan wrote:
I had a brief look at the dlib code. I don't think it's a problem with the va stuff. I have one warning when compiling dlib.c:
/usr/nekoware/gcc-4.7/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I/usr/local/include -I/usr/nekoware/include -I/usr/nekoware/gcc-4.7/include/c++/4.7.1 -I/usr/local/include -mtune=r5000 -mips4 -mabi=n32 -DD_DNS_THREADED -D_REENTRANT -D_THREAD_SAFE -Wall -W -Wno-unused-parameter -Waggregate-return -MT dlib.o -MD -MP -MF .deps/dlib.Tpo -c -o dlib.o dlib.c dlib.c: In function 'dStr_printable': dlib.c:514:7: warning: array subscript has type 'char' [-Wchar-subscripts] mv -f .deps/dlib.Tpo .deps/dlib.Po rm -f libDlib.a ar cru libDlib.a dlib.o : libDlib.a
This is the line:
if (isprint(in->str[i]) || (in->str[i] == '\n')) {
isprintf is defined in Irix
extern int isprint(int);
The subscript 'i'?
int i; it's defined in the function dStr_printable: /* * Return a printable representation of the provided Dstr, limited to a length * of roughly maxlen. * * This is NOT threadsafe. */ const char *dStr_printable(Dstr *in, int maxlen) { int i; static const char *const HEX = "0123456789ABCDEF"; static Dstr *out = NULL; if (in == NULL) return NULL; if (out) dStr_truncate(out, 0); else out = dStr_sized_new(in->len); for (i = 0; (i < in->len) && (out->len < maxlen); ++i) { if (isprint(in->str[i]) || (in->str[i] == '\n')) { dStr_append_c(out, in->str[i]); } else { dStr_append_l(out, "\\x", 2); dStr_append_c(out, HEX[(in->str[i] >> 4) & 15]); dStr_append_c(out, HEX[in->str[i] & 15]); } } if (out->len >= maxlen) dStr_append(out, "..."); return out->str; }