Re: warning: comparison of integer expressions of different signedness related to simd.h

Поиск
Список
Период
Сортировка
От John Naylor
Тема Re: warning: comparison of integer expressions of different signedness related to simd.h
Дата
Msg-id CAFBsxsHB3YQ7Hr2q7O--mAnQd66oiZqQ+p7n=QLEbXn7dCCuZg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: warning: comparison of integer expressions of different signedness related to simd.h  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sat, Sep 3, 2022 at 12:57 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> John Naylor <john.naylor@enterprisedb.com> writes:
> > On Sat, Sep 3, 2022 at 12:30 PM Pavel Stehule <pavel.stehule@gmail.com> wrote:
> >> /usr/local/pgsql/master/include/server/port/simd.h: In function ‘vector8_has’:
> >> /usr/local/pgsql/master/include/server/port/simd.h:168:27: warning: comparison of integer expressions of different
signedness:‘int’ and ‘long unsigned int’ [-Wsign-compare] 
> >> 168 |         for (int i = 0; i < sizeof(Vector8); i++)
>
> > "int" should probably be "Size" -- does that remove the warning?
>
> Agreed, should be Size or size_t, or else cast the sizeof() result.
> But I wonder why none of the buildfarm is showing such a warning.

If I add -Wsign-compare to CPPFLAGS, I get dozens of warnings all over
the place. It's probably unreasonable for extensions to expect to
compile cleanly with warnings that the core server doesn't use, but
this header is clearly wrong and easy to remedy, so I've pushed a
patch.

--
John Naylor
EDB: http://www.enterprisedb.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Zhihong Yu
Дата:
Сообщение: freeing LDAPMessage in CheckLDAPAuth
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Can we avoid chdir'ing in resolve_symlinks() ?