[sane-devel] wrong assumption on char signedness
Henning Meier-Geinitz
henning at meier-geinitz.de
Wed Oct 16 09:42:21 BST 2002
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
More information about the sane-devel
mailing list