Re: Some architectures need "signed char" declarations - Mailing list pgsql-hackers

From Doug McNaught
Subject Re: Some architectures need "signed char" declarations
Date
Msg-id m3wuyr70lx.fsf@varsoon.denali.to
Whole thread Raw
In response to Some architectures need "signed char" declarations  (Oliver Elphick <olly@lfix.co.uk>)
List pgsql-hackers
Doug Royer <Doug@royer.com> writes:

> I deleted the original post, but I think the issue was signed
> versus unsigned comparisons. I think he was saying the
> variable should be explicitly declared as 'signed int'
> (or signed char) and not 'int' (or char) because EOF is (-1).
> 
>     unsigned int foo;
> 
>     if (foo == -1) ...    causes a warning (or errors)
>                 on many compilers.
> 
> And if the default for int or char is unsigned as it can
> be on some systems, the code does exactly that.
> 
> Perhaps he is just wanted to reduce the build time noise?
> 
> Apologies if this was not on point.

The point is that this is potentially buggy code.  

-Doug
-- 
Let us cross over the river, and rest under the shade of the trees.  --T. J. Jackson, 1863


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: again on index usage
Next
From: Tom Lane
Date:
Subject: Re: RC1 time?