[sane-devel] wrong assumption on char signedness

Frank Zago fzago at austin.rr.com
Wed Oct 16 00:34:44 BST 2002


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.





More information about the sane-devel mailing list