From: Chapman Flack <jcflack@acm.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Sehrope Sarkuni <sehrope@jackdb.com>
Cc: Daniel Gustafsson <daniel@yesql.se>
Cc: Peter Eisentraut <peter@eisentraut.org>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Replace px_memset() with explicit_bzero()
Date: Tue, 25 Aug 2026 10:06:57 -0400
Message-ID: <6A8DA181.2010503@acm.org> (raw)
In-Reply-To: <618198.1787664052@sss.pgh.pa.us>
References: <a035c67f-4aa8-42e0-bb24-7b5abe927af4@eisentraut.org>
<BEA9F53A-125E-4CD0-8016-54D3F3AB2B6E@yesql.se>
<CAH7T-aqZE9O+9YK8CPzcuFjOu_1wBxjhnjNR_MAFiunQDYZ06g@mail.gmail.com>
<618198.1787664052@sss.pgh.pa.us>
> +1 for fixing that. Also I think project style is to write sizeof
> with parens.
For as long as I can remember, I have written it with parens when applied
to a type, but without parens when applied to a variable. That's long enough
that I had forgotten why, but Gemini reassures me there's not only a basis
in the language spec (the parens are mandatory when applied to a type) but
also a widely-practiced convention to visibly distinguish the two cases.
Perhaps supporting the idea of a project style that differs, many of
the first hits in our tree from
grep -r '\<sizeof[[:space:]]*[^([:space:]]' src
turn up in imported code like pg_bsd_indent and zic. But I do also turn up
35 matching lines in src/{backend,interfaces}, so there is some precedent
within the project.
Regards,
-Chap
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: jcflack@acm.org, tgl@sss.pgh.pa.us, sehrope@jackdb.com, daniel@yesql.se, peter@eisentraut.org
Subject: Re: Replace px_memset() with explicit_bzero()
In-Reply-To: <6A8DA181.2010503@acm.org>
References: <a035c67f-4aa8-42e0-bb24-7b5abe927af4@eisentraut.org> <BEA9F53A-125E-4CD0-8016-54D3F3AB2B6E@yesql.se> <CAH7T-aqZE9O+9YK8CPzcuFjOu_1wBxjhnjNR_MAFiunQDYZ06g@mail.gmail.com> <618198.1787664052@sss.pgh.pa.us> <6A8DA181.2010503@acm.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox