Remove unnecessary casts in printf format arguments

Started by Peter Eisentraut7 days ago3 messages
#1Peter Eisentraut
Peter Eisentraut
peter@eisentraut.org
3 attachment(s)

Attached are some patches to remove unnecessary casts in printf format
arguments. Many of these are apparently left over from before use of
%zu/%zd and PRIu64/PRId64 were possible. Additionally, there are a few
where the cast just cast to the type the input already had, or it just
uselessly cast to a different type instead of using the right format
argument.

Attachments:

0001-Remove-unnecessary-casts-in-printf-format-arguments-.patchtext/plain; charset=UTF-8; name=0001-Remove-unnecessary-casts-in-printf-format-arguments-.patch
0002-Clean-up-int64-related-format-strings.patchtext/plain; charset=UTF-8; name=0002-Clean-up-int64-related-format-strings.patch
0003-Remove-useless-casts-in-format-arguments.patchtext/plain; charset=UTF-8; name=0003-Remove-useless-casts-in-format-arguments.patch
#2Bertrand Drouvot
Bertrand Drouvot
bertranddrouvot.pg@gmail.com
In reply to: Peter Eisentraut (#1)
Re: Remove unnecessary casts in printf format arguments

Hi,

On Thu, Dec 04, 2025 at 01:19:07PM +0100, Peter Eisentraut wrote:

Attached are some patches to remove unnecessary casts in printf format
arguments. Many of these are apparently left over from before use of
%zu/%zd and PRIu64/PRId64 were possible. Additionally, there are a few
where the cast just cast to the type the input already had, or it just
uselessly cast to a different type instead of using the right format
argument.

I did look at all of them and did not see any issues, so that LGTM.

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

#3Peter Eisentraut
Peter Eisentraut
peter@eisentraut.org
In reply to: Bertrand Drouvot (#2)
Re: Remove unnecessary casts in printf format arguments

On 04.12.25 14:51, Bertrand Drouvot wrote:

On Thu, Dec 04, 2025 at 01:19:07PM +0100, Peter Eisentraut wrote:

Attached are some patches to remove unnecessary casts in printf format
arguments. Many of these are apparently left over from before use of
%zu/%zd and PRIu64/PRId64 were possible. Additionally, there are a few
where the cast just cast to the type the input already had, or it just
uselessly cast to a different type instead of using the right format
argument.

I did look at all of them and did not see any issues, so that LGTM.

committed, thanks