Re: [PATCH] add relation and block-level filtering to pg_waldump

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, David Christensen <david(dot)christensen(at)crunchydata(dot)com>
Cc: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] add relation and block-level filtering to pg_waldump
Date: 2022-03-23 20:53:21
Message-ID: bd843dc2-12be-8b4b-c260-3d3b85b52a2b@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 21.03.22 05:55, Thomas Munro wrote:
> [04:30:50.630] pg_waldump.c:963:26: error: format ‘%u’ expects
> argument of type ‘unsigned int *’, but argument 3 has type ‘ForkNumber
> *’ [-Werror=format=]
> [04:30:50.630] 963 | if (sscanf(optarg, "%u",
> &config.filter_by_relation_forknum) != 1 ||
> [04:30:50.630] | ~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> [04:30:50.630] | | |
> [04:30:50.630] | | ForkNumber *
> [04:30:50.630] | unsigned int *
>
> And now that this gets to the CompilerWarnings CI task, it looks like
> GCC doesn't like an enum as a scanf %u destination (I didn't see that
> warning locally when I compiled the above fixup because clearly Clang
> is cool with it...). Probably needs a temporary unsigned int to
> sscanf into first.

That's because ForkNum is a signed type. You will probably succeed if
you use "%d" instead.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2022-03-23 20:56:39 Re: SQL/JSON: functions
Previous Message Robert Haas 2022-03-23 20:53:13 Re: Removing more vacuumlazy.c special cases, relfrozenxid optimizations