| From: | zengman <zengman(at)halodbtech(dot)com> |
|---|---|
| To: | Álvaro Herrera <alvherre(at)kurilemu(dot)de>, andres <andres(at)anarazel(dot)de> |
| Cc: | pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: remove the unneeded header file math.h in binaryheap.c |
| Date: | 2026-01-16 01:24:22 |
| Message-ID: | tencent_2110AD724E3CC2802848274B@qq.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
> > > I removed the <math.h> include from two files `dt_common.c` and
> > > `timestamp.c`, and the code compiles successfully in my environment.
> > > Would you consider adding this to the patch?
>
> I would rather not touch ecpg. (I skipped those files purposefully.)
Ok, then let's leave this part untouched. But I still sorted out the timeline of changes related to <math.h> in these two files:
```
dt_common.c
cb8b1299a353: Added <math.h> to support the JROUND macro (which relies on the rint() function and requires the function prototype from <math.h>)
313ed1ed9498: Removed usage of the JROUND macro (replaced with *fsec = time - *sec;), so the rint() function is no longer needed
timestamp.c
2e6f97560a8: <math.h> was included when the file was created to support the JROUND macro
313ed1ed9498: Renamed JROUND to TSROUND and added usage of the ceil() function
b9d092c962e: Removed all floating-point timestamp related code (including TSROUND and ceil())
```
Feel free to use this if needed later.
> Just because removing a platform include file works in some environment is
> *NOT* sufficient to remove platform include files. There are a lot of
> variations between platforms about when some include files are implicitly
> included via other include files. Just removing them because it works on one
> platform ends up with more niche operating systems failing to build, which we
> may only figure out months or even years down the road.
>
> At the very least you need to figure out why the includes where added and why
> that reason is not present anymore.
You're right - sorry for the oversight.
Thank you all for your guidance.
--
Regards,
Man Zeng
www.openhalo.org
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jacob Champion | 2026-01-16 01:54:00 | Re: Custom oauth validator options |
| Previous Message | yangyz | 2026-01-16 00:58:06 | fix a spelling mistake |