[sane-devel] wrong assumption on char signedness

Frank Zago fzago@austin.rr.com
Tue, 15 Oct 2002 18:34:44 -0500


Aurelien Jarno wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi all,
> 
> In backends/plustek-usbshading.c, in function usb_GetNewOffset, there 
> is 
> 
> if( pcOffset[dw] >= 0 )
> 
> pcOffset[dw] is defined as char. On some architectures (at least arm, 
> powerpc and s390), char is per default unsigned on. This causes a 
> warning on compilation ("warning: comparison is always true due to 
> limited range of data type"), and may cause some errors at run time.
> 
> I have made a small patch, but I am not sure it corrects everything.

What about adding -fsigned-char to CFLAGS instead?

Frank.