Re: Is WAL_DEBUG related code still relevant today?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Is WAL_DEBUG related code still relevant today?
Date: 2023-12-06 15:06:17
Message-ID: 1100556.1701875177@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(at)eisentraut(dot)org> writes:
> This kind of thing could be mostly avoided if we didn't hide all the
> WAL_DEBUG behind #ifdefs. For example, in the attached patch, I instead
> changed it so that
> if (XLOG_DEBUG)
> resolves to
> if (false)
> in the normal case. That way, we don't need to wrap that in #ifdef
> WAL_DEBUG, and the compiler can see the disabled code and make sure it
> continues to build.

Hmm, maybe, but I'm not sure this would be an unalloyed good.
The main concern I have is compilers and static analyzers starting
to bleat about unreachable code (warnings like "variable set but
never used", or the like, seem plausible). The dead code would
also decrease our code coverage statistics, not that those are
wonderful now.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Dolgov 2023-12-06 15:07:22 Re: [RFC] Clang plugin for catching suspicious typedef casting
Previous Message Junwang Zhao 2023-12-06 14:32:14 Re: Make COPY format extendable: Extract COPY TO format implementations