Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fKcZ8-0004A6-FO for pgsql-hackers@arkaria.postgresql.org; Mon, 21 May 2018 04:36:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fKcZ7-0000Wo-AH for pgsql-hackers@arkaria.postgresql.org; Mon, 21 May 2018 04:36:57 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fKcZ7-0000Wf-0B for pgsql-hackers@lists.postgresql.org; Mon, 21 May 2018 04:36:57 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fKcZ4-0000Ho-Nj for pgsql-hackers@lists.postgresql.org; Mon, 21 May 2018 04:36:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w4L4arFU024987; Mon, 21 May 2018 00:36:53 -0400 From: Tom Lane To: Thomas Munro cc: PostgreSQL Hackers Subject: Re: Allowing printf("%m") only where it actually works In-reply-to: <14176.1526874887@sss.pgh.pa.us> References: <2975.1526862605@sss.pgh.pa.us> <14176.1526874887@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sun, 20 May 2018 23:54:47 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <24985.1526877413.1@sss.pgh.pa.us> Date: Mon, 21 May 2018 00:36:53 -0400 Message-ID: <24986.1526877413@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ... and, while we're thinking about this, how can we prevent the reverse problem of using strerror(errno) where you should have used %m? That is evidently not academic either, cf 81256cd. I am wondering whether the elog/ereport macros can locally define some version of "errno" that would cause a compile failure if it's referenced within the macro args. But I'm too tired to work it out in detail. regards, tom lane