Re: -Wformat-signedness

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: -Wformat-signedness
Дата
Msg-id 667dccce-b44d-40f3-9b80-4195027ddaf3@eisentraut.org
обсуждение исходный текст
Ответ на Re: -Wformat-signedness  (Andy Fan <zhihuifan1213@163.com>)
Список pgsql-hackers
On 27.10.24 04:59, Andy Fan wrote:
>> I haven't found anything that is a really serious bug, but I imagine you
>> could run into trouble in various ways when you exceed the INT_MAX
>> value.  But then again, if you use up INT_MAX WAL timelines, you
>> probably have other problems. ;-)
> Me too, just that want some clean code:) But FWIW, "-Wformat-signedness"
> is not supported by clang so far, so if people is using clang, they
> still can't benefit from this changes.

clang 19 supports it now.

> My soluation (I use clang
> everyday) is adding a "gcc-checker" for my c file, if I make such
> mistake, it can remind me directly.

I think it could be useful to set up some better test coverage for 
various things overflowing signed integer maximums.  For example, maybe 
you could hack initdb to advance the OID counter to INT32_MAX+1 or 
thereabouts and run the test suites from there.  That would also catch 
things like inappropriate uses of atoi(), things beyond just the format 
strings.




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