Re: Some architectures need "signed char" declarations

Поиск
Список
Период
Сортировка
От Doug McNaught
Тема Re: Some architectures need "signed char" declarations
Дата
Msg-id m3wuyr70lx.fsf@varsoon.denali.to
обсуждение исходный текст
Ответ на Some architectures need "signed char" declarations  (Oliver Elphick <olly@lfix.co.uk>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: again on index usage
Следующее
От: Tom Lane
Дата:
Сообщение: Re: RC1 time?