Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1heJXw-0000Q3-8c for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Jun 2019 13:25:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1heJXv-0005wQ-5G for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Jun 2019 13:25:39 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1heJXu-0005ra-Ll for pgsql-hackers@lists.postgresql.org; Fri, 21 Jun 2019 13:25:38 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1heJXq-0003NM-7i for pgsql-hackers@postgresql.org; Fri, 21 Jun 2019 13:25:35 +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 x5LDPVaJ027861; Fri, 21 Jun 2019 09:25:31 -0400 From: Tom Lane To: Peter Eisentraut cc: pgsql-hackers Subject: Re: using explicit_bzero In-reply-to: <42d26bde-5d5b-c90d-87ae-6cab875f73be@2ndquadrant.com> References: <42d26bde-5d5b-c90d-87ae-6cab875f73be@2ndquadrant.com> Comments: In-reply-to Peter Eisentraut message dated "Fri, 21 Jun 2019 09:25:43 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <27859.1561123531.1@sss.pgh.pa.us> Date: Fri, 21 Jun 2019 09:25:31 -0400 Message-ID: <27860.1561123531@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Peter Eisentraut writes: > +#ifndef HAVE_EXPLICIT_BZERO > +#define explicit_bzero(b, len) bzero(b, len) > +#endif This presumes that every platform has bzero, which is unsafe (POSIX doesn't specify it) and is an assumption we kicked to the curb a dozen years ago (067a5cdb3). Please use memset() for the substitute instead. Also, I'm a bit suspicious of using AC_CHECK_FUNCS for this; that generally Doesn't Work for anything that's not a vanilla out-of-line function. Are we worried about people implementing this as a macro, compiler built-in, etc? regards, tom lane