Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4c1a1a3

Browse files
committed
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 AFAICTSolaris 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-trackwarnings where we can easily do so.
1 parent1f6e0ce commit4c1a1a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/backend/port/sysv_shmem.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ static void
289289
IpcMemoryDetach(intstatus,Datumshmaddr)
290290
{
291291
/* Detach System V shared memory block. */
292-
if (shmdt(DatumGetPointer(shmaddr))<0)
292+
if (shmdt((void*)DatumGetPointer(shmaddr))<0)
293293
elog(LOG,"shmdt(%p) failed: %m",DatumGetPointer(shmaddr));
294294
}
295295

@@ -323,7 +323,7 @@ PGSharedMemoryIsInUse(unsigned long id1, unsigned long id2)
323323
IpcMemoryStatestate;
324324

325325
state=PGSharedMemoryAttach((IpcMemoryId)id2,NULL,&memAddress);
326-
if (memAddress&&shmdt(memAddress)<0)
326+
if (memAddress&&shmdt((void*)memAddress)<0)
327327
elog(LOG,"shmdt(%p) failed: %m",memAddress);
328328
switch (state)
329329
{
@@ -807,7 +807,7 @@ PGSharedMemoryCreate(Size size,
807807
break;
808808
}
809809

810-
if (oldhdr&&shmdt(oldhdr)<0)
810+
if (oldhdr&&shmdt((void*)oldhdr)<0)
811811
elog(LOG,"shmdt(%p) failed: %m",oldhdr);
812812
}
813813

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp