Remove useless casts to (void *)

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>
Subject: Remove useless casts to (void *)
Date: 2025-11-20 13:33:51
Message-ID: aR8Yv+uATLKbJCgI@ip-10-97-1-34.eu-west-3.compute.internal
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

I was working on something similar to [1] (which led to 7f798aca1d5) and I think
that 7f798aca1d5 missed removing some useless casts to (void *).

Meaning, the ones in the attached patch in:

- inval.c
- bump.c
- injection_point.c
- copyfromparse.c
- extension.c
- wparser.c

I did not find any reasons in the thread as to why those ones were not removed.

The attached also remove casts that have been added since 7f798aca1d5, the ones
in pg_publication.c, lock.c and tuplesortvariants.c.

The patch has been generated with the help of the .cocci script [2] (though I
manually reviewed and removed some matches that, I think, were not appropriate).

[1]: https://www.postgresql.org/message-id/flat/461ea37c-8b58-43b4-9736-52884e862820%40eisentraut.org
[2]: https://github.com/bdrouvot/coccinelle_on_pg/blob/main/misc/remove_useless_casts_to_void_star.cocci

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v1-0001-Remove-useless-casts-to-void.patch text/x-diff 5.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2025-11-20 13:44:04 Re: 10% drop in code line count in PG 17
Previous Message Aleksander Alekseev 2025-11-20 13:28:06 Re: pg_utility ?