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 1rs8BF-0050oi-G1 for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Apr 2024 21:30:02 +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 1rs8BE-0094Mz-Fo for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Apr 2024 21:30:00 +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 1rs8BE-0094Mr-6O for pgsql-hackers@lists.postgresql.org; Wed, 03 Apr 2024 21:30:00 +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 1rs8B9-000QDm-DK for pgsql-hackers@lists.postgresql.org; Wed, 03 Apr 2024 21:29:58 +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 433LTifn372770; Wed, 3 Apr 2024 17:29:44 -0400 From: Tom Lane To: Alvaro Herrera cc: Jelte Fennema-Nio , Noah Misch , Jacob Champion , Denis Laxalde , vignesh C , Thomas Munro , Greg Stark , "Gregory Stark (as CFM)" , Jelte Fennema , Daniel Gustafsson , Peter Eisentraut , Andres Freund , Justin Pryzby , Robert Haas , pgsql-hackers@lists.postgresql.org, Etsuro Fujita Subject: Re: [EXTERNAL] Re: Add non-blocking version of PQcancel In-reply-to: <202403281033.m43cmgh5mhz7@alvherre.pgsql> References: <202403281033.m43cmgh5mhz7@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Thu, 28 Mar 2024 11:33:00 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <372768.1712179784.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 03 Apr 2024 17:29:44 -0400 Message-ID: <372769.1712179784@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera writes: > Great, thanks for looking. Pushed now, I'll be closing the commitfest > entry shortly. On my machine, headerscheck does not like this: $ src/tools/pginclude/headerscheck --cplusplus In file included from /tmp/headerscheck.4gTaW5/test.cpp:3: ./src/include/libpq/libpq-be-fe-helpers.h: In function 'char* libpqsrv_can= cel(PGconn*, TimestampTz)': ./src/include/libpq/libpq-be-fe-helpers.h:393:10: warning: ISO C++ forbids= converting a string constant to 'char*' [-Wwrite-strings] return "out of memory"; ^~~~~~~~~~~~~~~ ./src/include/libpq/libpq-be-fe-helpers.h:421:13: warning: ISO C++ forbids= converting a string constant to 'char*' [-Wwrite-strings] error =3D "cancel request timed out"; ^~~~~~~~~~~~~~~~~~~~~~~~~~ The second part of that could easily be fixed by declaring "error" as "const char *". As for the first part, can we redefine the whole function as returning "const char *"? (If not, this coding is very questionable anyway.) regards, tom lane