Re: Remove useless casts to (void *)
Bruce Momjian <bruce@momjian.us>
From: Bruce Momjian <bruce@momjian.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Eisentraut <peter@eisentraut.org>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2024-11-01T01:10:01Z
Lists: pgsql-hackers
On Tue, Oct 29, 2024 at 10:20:03AM -0400, Tom Lane wrote: > Peter Eisentraut <peter@eisentraut.org> writes: > > There are a bunch of (void *) casts in the code that don't make sense to > > me. I think some of these were once necessary because char * was used > > in place of void * for some function arguments. And some of these were > > probably just copied around without further thought. I went through and > > cleaned up most of these. I didn't find any redeeming value in these. > > They are just liable to hide actual problems such as incompatible types. > > But maybe there are other opinions. > > I don't recall details, but I'm fairly sure some of these prevented > compiler warnings on some (old?) compilers. Hard to be sure if said > compilers are all gone. > > Looking at the sheer size of the patch, I'm kind of -0.1, just > because I'm afraid it's going to create back-patching gotchas. > I don't really find that it's improving readability, though > clearly that's a matter of opinion. I kind of liked the patch in terms of simplifying things. -- Bruce Momjian <bruce@momjian.us> https://momjian.us EDB https://enterprisedb.com When a patient asks the doctor, "Am I going to die?", he means "Am I going to die soon?"
Commits
-
Remove PointerIsValid()
- a5b35fcedb54 19 (unreleased) landed
-
Define __EXTENSIONS__ on Solaris, too.
- 3b08d5224d7d 18.0 landed
-
Define _POSIX_C_SOURCE as 200112L on Solaris.
- 32a7deb2a02b 18.0 landed
-
Remove useless casts to (void *)
- 7f798aca1d5d 18.0 landed