pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Code review for pg_verify_checksums.c.
2+ messages / 1 participants
[nested] [flat]

* pgsql: Code review for pg_verify_checksums.c.
@ 2018-08-31 17:42  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2018-08-31 17:42 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Code review for pg_verify_checksums.c.

Use postgres_fe.h, since this is frontend code.  Pretend that we've heard
of project style guidelines for, eg, #include order.  Use BlockNumber not
int arithmetic for block numbers, to avoid misbehavior with relations
exceeding 2^31 blocks.  Avoid an unnecessary strict-aliasing warning
(per report from Michael Banck).  Const-ify assorted stuff.  Avoid
scribbling on the output of readdir() -- perhaps that's safe in practice,
but POSIX forbids it, and this code has so far earned exactly zero
credibility portability-wise.  Editorialize on an ambiguously-worded
message.

I did not touch the problem of the "buf" local variable being possibly
insufficiently aligned; that's not specific to this code, and seems like
it should be fixed as part of a different, larger patch.

Discussion: https://postgr.es/m/1535618100.1286.3.camel@credativ.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d9c366f9e8017306201fe12d27212d8720395c04

Modified Files
--------------
src/bin/pg_verify_checksums/pg_verify_checksums.c | 47 +++++++++++------------
1 file changed, 23 insertions(+), 24 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Code review for pg_verify_checksums.c.
@ 2018-08-31 17:42  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2018-08-31 17:42 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Code review for pg_verify_checksums.c.

Use postgres_fe.h, since this is frontend code.  Pretend that we've heard
of project style guidelines for, eg, #include order.  Use BlockNumber not
int arithmetic for block numbers, to avoid misbehavior with relations
exceeding 2^31 blocks.  Avoid an unnecessary strict-aliasing warning
(per report from Michael Banck).  Const-ify assorted stuff.  Avoid
scribbling on the output of readdir() -- perhaps that's safe in practice,
but POSIX forbids it, and this code has so far earned exactly zero
credibility portability-wise.  Editorialize on an ambiguously-worded
message.

I did not touch the problem of the "buf" local variable being possibly
insufficiently aligned; that's not specific to this code, and seems like
it should be fixed as part of a different, larger patch.

Discussion: https://postgr.es/m/1535618100.1286.3.camel@credativ.de

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d787af7badfe8c4c9afb7f0af9958a69b723a212

Modified Files
--------------
src/bin/pg_verify_checksums/pg_verify_checksums.c | 47 +++++++++++------------
1 file changed, 23 insertions(+), 24 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2018-08-31 17:42 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-08-31 17:42 pgsql: Code review for pg_verify_checksums.c. Tom Lane <tgl@sss.pgh.pa.us>
2018-08-31 17:42 pgsql: Code review for pg_verify_checksums.c. Tom Lane <tgl@sss.pgh.pa.us>

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