Re: pgsql: pg_rewind: Fetch small files according to new size. - Mailing list pgsql-committers

From Daniel Gustafsson
Subject Re: pgsql: pg_rewind: Fetch small files according to new size.
Date
Msg-id D95829A7-630F-4CB8-AD32-C450210F606A@yesql.se
Whole thread Raw
In response to Re: pgsql: pg_rewind: Fetch small files according to new size.  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: pgsql: pg_rewind: Fetch small files according to new size.  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-committers
> On 5 Apr 2022, at 15:36, Daniel Gustafsson <daniel@yesql.se> wrote:
>
>> On 5 Apr 2022, at 15:02, Daniel Gustafsson <dgustafsson@postgresql.org> wrote:
>>
>> pg_rewind: Fetch small files according to new size.
>
> The buildfarm is less impressed than CI was, I’m collecting more feedback and will then fix.

Sorry for being slow, life took over and children with fever took priority.
The error in question was:

local_source.c:118:15: error: format specifies type 'unsigned long long' but the argument has type 'size_t' (aka
'unsignedint') [-Werror,-Wformat] 
                                 srcpath, len, written_len);
                                 ~~~~~~~~~^~~~~~~~~~~~~~~~~

I'm running a fixup with casting to int and printing with %d (like how
pg_rewind.c:digestControlFile already does it for printing a size_t) through CI
just to be sure and will push once it's had a green run:

-               pg_fatal("size of source file \"%s\" changed concurrently: " UINT64_FORMAT " bytes expected, "
UINT64_FORMAT" copied", 
-                                srcpath, len, written_len);
+               pg_fatal("size of source file \"%s\" changed concurrently: %d bytes expected, %d copied",
+                                srcpath, (int) len, (int) written_len);

--
Daniel Gustafsson        https://vmware.com/




pgsql-committers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: pgsql: JSON_TABLE
Next
From: Daniel Gustafsson
Date:
Subject: pgsql: Fix compilerwarning in logging size_t