> From: carlo.bramix <carlo.bra...@libero.it> > > Hello, > unfortunately that code still fails into libguile/print.c > Infact, a signed char just arrives to 127 and the " < 128" causes: > > ../../guile-git/libguile/print.c:1101: warning: comparison is always true due > to > limited range of data type > ../../guile-git/libguile/print.c:1108: warning: comparison is always true due > to > limited range of data type
Doh! You're right. > > But in this manner it seems ok: > > #define SCM_MAKE_CHAR(x) \ > (((scm_t_int32) (x) + 128) < 128 \ > ? SCM_MAKE_ITAG8 ((scm_t_bits) (unsigned char) (x), scm_tc8_char) \ > : SCM_MAKE_ITAG8 ((scm_t_bits) (x), scm_tc8_char)) Alternately, you could put in any number between 0 and 127, I think, and get the correct behavior. #define SCM_MAKE_CHAR(x) \ ((x) < 64 \ ? SCM_MAKE_ITAG8 ((scm_t_bits) (unsigned char) (x), scm_tc8_char) \ : SCM_MAKE_ITAG8 ((scm_t_bits) (x), scm_tc8_char)) -Mike