Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIAoF-00CfaB-1g for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Dec 2024 18:06:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tIAoC-002EpN-5J for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Dec 2024 18:06:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIAoB-002EpF-RU for pgsql-hackers@lists.postgresql.org; Mon, 02 Dec 2024 18:06:09 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIAo7-000gx7-Ob for pgsql-hackers@postgresql.org; Mon, 02 Dec 2024 18:06:07 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 4B2I61pv1654509; Mon, 2 Dec 2024 13:06:01 -0500 From: Tom Lane To: Peter Eisentraut cc: Andreas Karlsson , pgsql-hackers Subject: Re: Remove useless casts to (void *) In-reply-to: <8da4a1fc-5cd3-4414-a8a1-57929b85285c@eisentraut.org> References: <461ea37c-8b58-43b4-9736-52884e862820@eisentraut.org> <166213.1730211603@sss.pgh.pa.us> <3ab19dcf-7ca5-4de0-89b0-1ee344a42105@eisentraut.org> <8da4a1fc-5cd3-4414-a8a1-57929b85285c@eisentraut.org> Comments: In-reply-to Peter Eisentraut message dated "Thu, 28 Nov 2024 08:50:32 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1654507.1733162761.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 02 Dec 2024 13:06:01 -0500 Message-ID: <1654508.1733162761@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut writes: > Committed, thanks. Now that we have a more-or-less full set of buildfarm results on this, I checked for new warnings, and found two: pg_shmem.c: In function 'PGSharedMemoryIsInUse': pg_shmem.c:323:33: warning: passing argument 1 of 'shmdt' from incompatibl= e pointer type [-Wincompatible-pointer-types] 323 | if (memAddress && shmdt(memAddress) < 0) | ^~~~~~~~~~ | | | PGShmemHeader * In file included from pg_shmem.c:27: /usr/include/sys/shm.h:131:11: note: expected 'char *' but argument is of = type 'PGShmemHeader *' 131 | int shmdt(char *); | ^~~~~~ pg_shmem.c: In function 'PGSharedMemoryCreate': pg_shmem.c:838:37: warning: passing argument 1 of 'shmdt' from incompatibl= e pointer type [-Wincompatible-pointer-types] 838 | if (oldhdr && shmdt(oldhdr) < 0) | ^~~~~~ | | | PGShmemHeader * /usr/include/sys/shm.h:131:11: note: expected 'char *' but argument is of = type 'PGShmemHeader *' 131 | int shmdt(char *); | ^~~~~~ This is from hake[1], which is running OpenIndiana/illumos. That platform shows a couple of other strange warnings, so maybe re-eliminating these two is not worth worrying about, but nonetheless the casts to void * were doing something here. regards, tom lane [1] https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=3Dhake&d= t=3D2024-12-02%2017%3A19%3A40&stg=3Dmake