On 2022-Apr-05, Daniel Gustafsson wrote:

> local_source.c:118:15: error: format specifies type 'unsigned long long' but 
> the argument has type 'size_t' (aka 'unsigned int') [-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);

Hmm, it is typical to cast file sizes to long long and print with %lld.
See d914eb347fcd for a recent example.

.. oh, I see you pushed already.  Not sure this is worth fixing, since
the original commit message claimed to involve only "small files".

I suppose having a non-relation-file in the datadir that's bigger than
4GB is not expected?

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
Essentially, you're proposing Kevlar shoes as a solution for the problem
that you want to walk around carrying a loaded gun aimed at your foot.
(Tom Lane)


Reply via email to