[sane-devel] wrong assumption on char signedness

Henning Meier-Geinitz henning@meier-geinitz.de
Wed, 16 Oct 2002 10:42:21 +0200


Hi,

On Tue, Oct 15, 2002 at 06:34:44PM -0500, Frank Zago wrote:
> 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?

That may work for a gcc based distribution but I suspect not every
C-compiler will understand it?

Bye,
  Henning