Re: remove the unneeded header file math.h in binaryheap.c - Mailing list pgsql-hackers

From Andres Freund
Subject Re: remove the unneeded header file math.h in binaryheap.c
Date
Msg-id rskt6xl2blrbfkks6gaeqlkx3smcpizhu632nypr7zht7yppqq@3fub3riwcdyj
Whole thread Raw
In response to Re: remove the unneeded header file math.h in binaryheap.c  ("zengman" <zengman@halodbtech.com>)
Responses Re: remove the unneeded header file math.h in binaryheap.c
List pgsql-hackers
Hi,

On 2026-01-15 23:08:28 +0800, zengman wrote:
> I removed the <math.h> include from two files `dt_common.c` and `timestamp.c`, and the code compiles successfully in
myenvironment.
 
> Would you consider adding this to the patch?

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.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: "zengman"
Date:
Subject: Re: remove the unneeded header file math.h in binaryheap.c
Next
From: Tom Lane
Date:
Subject: Re: remove the unneeded header file math.h in binaryheap.c