Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jrixs-0002Vu-Rr for pgsql-hackers@arkaria.postgresql.org; Sat, 04 Jul 2020 14:16:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jrixp-0006O0-CL for pgsql-hackers@arkaria.postgresql.org; Sat, 04 Jul 2020 14:16:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jrixp-0006Nt-4y for pgsql-hackers@lists.postgresql.org; Sat, 04 Jul 2020 14:16:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jrixi-0003dD-Aw for pgsql-hackers@postgresql.org; Sat, 04 Jul 2020 14:16:20 +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 064EG77U1183185; Sat, 4 Jul 2020 10:16:07 -0400 From: Tom Lane To: Peter Eisentraut cc: Andres Freund , pgsql-hackers Subject: Re: warnings for invalid function casts In-reply-to: References: <1e97628e-6447-b4fd-e230-d109cec2d584@2ndquadrant.com> <474790.1593526505@sss.pgh.pa.us> <20200630192135.nwlza2u57dy3qej4@alap3.anarazel.de> <496552.1593545900@sss.pgh.pa.us> <931660.1593787200@sss.pgh.pa.us> Comments: In-reply-to Peter Eisentraut message dated "Sat, 04 Jul 2020 13:36:44 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1183183.1593872167.1@sss.pgh.pa.us> Date: Sat, 04 Jul 2020 10:16:07 -0400 Message-ID: <1183184.1593872167@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Peter Eisentraut writes: > Do people prefer a typedef or just writing it out, like it's done in the > Python code? I'm for a typedef. There is *nothing* readable about "(void (*) (void))", and the fact that it's theoretically incorrect for the purpose doesn't exactly aid intelligibility either. With a typedef, not only are the uses more readable but there's a place to put a comment explaining that this is notionally wrong but it's what gcc specifies to use to suppress thus-and-such warnings. > But if we prefer a typedef then I'd propose > GenericFuncPtr like in the initial patch. That name is OK by me. regards, tom lane