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 1t5n4v-008Vhc-SP for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Oct 2024 14:20:13 +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 1t5n4u-00GrEp-2y for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Oct 2024 14:20:12 +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 1t5n4t-00GrEg-PU for pgsql-hackers@lists.postgresql.org; Tue, 29 Oct 2024 14:20:12 +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 1t5n4n-003Sbl-OW for pgsql-hackers@postgresql.org; Tue, 29 Oct 2024 14:20:10 +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 49TEK3vm166214; Tue, 29 Oct 2024 10:20:03 -0400 From: Tom Lane To: Peter Eisentraut cc: pgsql-hackers Subject: Re: Remove useless casts to (void *) In-reply-to: <461ea37c-8b58-43b4-9736-52884e862820@eisentraut.org> References: <461ea37c-8b58-43b4-9736-52884e862820@eisentraut.org> Comments: In-reply-to Peter Eisentraut message dated "Tue, 29 Oct 2024 09:06:32 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <166212.1730211603.1@sss.pgh.pa.us> Date: Tue, 29 Oct 2024 10:20:03 -0400 Message-ID: <166213.1730211603@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut 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. regards, tom lane