aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-02-15 17:17:25 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2022-02-15 17:17:28 -0500
commit4c1a1a347a47df7c17b0fd212436ccbb896c47ca (patch)
tree2873c5f629adb919eb07277d3a1a58d8dd655e51 /src
parent1f6e0ce3beb45f23e4774148bd654d915be8d611 (diff)
downloadpostgresql-4c1a1a347a47df7c17b0fd212436ccbb896c47ca.tar.gz
postgresql-4c1a1a347a47df7c17b0fd212436ccbb896c47ca.zip
Ensure that the argument of shmdt(2) is declared "void *".
Our gcc-on-Solaris buildfarm members emit "incompatible pointer type" warnings in places where it's not. This is a bit odd, since AFAICT Solaris follows the POSIX spec in declaring shmdt's argument as "const void *", and you'd think any pointer argument would satisfy that. But whatever. Part of a general push to remove off-the-beaten-track warnings where we can easily do so.
Diffstat (limited to 'src')
-rw-r--r--src/backend/port/sysv_shmem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/port/sysv_shmem.c b/src/backend/port/sysv_shmem.c
index 821a2598f1b..ea287c733df 100644
--- a/src/backend/port/sysv_shmem.c
+++ b/src/backend/port/sysv_shmem.c
@@ -289,7 +289,7 @@ static void
IpcMemoryDetach(int status, Datum shmaddr)
{
/* Detach System V shared memory block. */
- if (shmdt(DatumGetPointer(shmaddr)) < 0)
+ if (shmdt((void *) DatumGetPointer(shmaddr)) < 0)
elog(LOG, "shmdt(%p) failed: %m", DatumGetPointer(shmaddr));
}
@@ -323,7 +323,7 @@ PGSharedMemoryIsInUse(unsigned long id1, unsigned long id2)
IpcMemoryState state;
state = PGSharedMemoryAttach((IpcMemoryId) id2, NULL, &memAddress);
- if (memAddress && shmdt(memAddress) < 0)
+ if (memAddress && shmdt((void *) memAddress) < 0)
elog(LOG, "shmdt(%p) failed: %m", memAddress);
switch (state)
{
@@ -807,7 +807,7 @@ PGSharedMemoryCreate(Size size,
break;
}
- if (oldhdr && shmdt(oldhdr) < 0)
+ if (oldhdr && shmdt((void *) oldhdr) < 0)
elog(LOG, "shmdt(%p) failed: %m", oldhdr);
}