public inbox for [email protected]  
help / color / mirror / Atom feed
From: Peter Eisentraut <[email protected]>
To: Thomas Munro <[email protected]>
To: David Christensen <[email protected]>
Cc: Bharath Rupireddy <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Subject: Re: [PATCH] add relation and block-level filtering to pg_waldump
Date: Wed, 23 Mar 2022 21:53:21 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+hUKG+i5mp1cxQ0B_04Pq6BJB_k=KfL0b2fdAQtKrGapapmbg@mail.gmail.com>
References: <[email protected]>
	<CALj2ACXjZRWXvUhvUh7xJeRJd7i40KXdS7p6eHHq+q4+xUNf9w@mail.gmail.com>
	<[email protected]>
	<CA+hUKGL6Oh86gBFT0fwLz7=fOpFWm4-fu6Xo9X9VcOKuJ6t9ow@mail.gmail.com>
	<CA+hUKG+i5mp1cxQ0B_04Pq6BJB_k=KfL0b2fdAQtKrGapapmbg@mail.gmail.com>

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.





view thread (16+ messages)  latest in thread

reply

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: [PATCH] add relation and block-level filtering to pg_waldump
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox