Re: using explicit_bzero - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: using explicit_bzero
Date
Msg-id 26f25674-9c4d-241f-0e74-3fee9860ca13@2ndquadrant.com
Whole thread Raw
In response to Re: using explicit_bzero  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: using explicit_bzero
List pgsql-hackers
On 2019-06-21 15:25, Tom Lane wrote:
> Peter Eisentraut <peter.eisentraut@2ndquadrant.com> 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.

OK, done.

> 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?

I think we should address that if we actually find such a case.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: Choosing values for multivariate MCV lists
Next
From: Peter Eisentraut
Date:
Subject: Re: using explicit_bzero