| From: | Peter Eisentraut <peter(at)eisentraut(dot)org> |
|---|---|
| To: | Andy Fan <zhihuifan1213(at)163(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com> |
| Cc: | Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> |
| Subject: | Re: -Wformat-signedness |
| Date: | 2024-10-29 06:38:36 |
| Message-ID: | 667dccce-b44d-40f3-9b80-4195027ddaf3@eisentraut.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andy Fan | 2024-10-29 06:45:58 | Re: detoast datum into the given buffer as a optimization. |
| Previous Message | Tender Wang | 2024-10-29 06:38:30 | Re: Wrong result when enable_partitionwise_join is on if collation of PartitionKey and Column is different. |