Re: Replace px_memset() with explicit_bzero()

From: Chapman Flack <jcflack(at)acm(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Sehrope Sarkuni <sehrope(at)jackdb(dot)com>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, Peter Eisentraut <peter(at)eisentraut(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Replace px_memset() with explicit_bzero()
Date: 2026-08-25 14:06:57
Message-ID: 6A8DA181.2010503@acm.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ayush Tiwari 2026-08-25 14:24:20 Re: More partition pruning bugs with multi-column RANGE partitions
Previous Message Melanie Plageman 2026-08-25 14:06:24 Re: Allow aggressive VACUUM to freeze without a cleanup lock