Re: Remove useless casts to (void *)

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Peter Eisentraut <peter@eisentraut.org>, Andreas Karlsson <andreas@proxel.se>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2024-12-02T22:11:30Z
Lists: pgsql-hackers
Thomas Munro <thomas.munro@gmail.com> writes:
> I wouldn't change that.  illumos is selecting the old pre-standard
> declaration here, but it knows the standard one:
> https://github.com/illumos/illumos-gate/blob/27ecbff00d8c86a2647d6fe325cacb220d712115/usr/src/uts/common/sys/shm.h#L129
> https://illumos.org/man/2/shmdt

Oh!  Kind of looks like we should be defining _POSIX_C_SOURCE=200112L,
at least on that platform.

> I don't know why we have only one tiny issue if the system headers
> think we want pre-POSIX stuff.

Agreed, I'd have expected more trouble than this.  But persuading
the system headers that we want a POSIX version from this century
seems like it might be a good idea to forestall future issues.

I'm inclined to propose adding something like

CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L"

to src/template/solaris.  Not sure if we have a corresponding
mechanism for meson, though.

			regards, tom lane



Commits

  1. Remove PointerIsValid()

  2. Define __EXTENSIONS__ on Solaris, too.

  3. Define _POSIX_C_SOURCE as 200112L on Solaris.

  4. Remove useless casts to (void *)