Re: Cast to uint16 in pg_checksum_page()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: David Steele <david(at)pgmasters(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Cast to uint16 in pg_checksum_page()
Date: 2020-03-04 06:05:03
Message-ID: 26710.1583301903@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Paquier <michael(at)paquier(dot)xyz> writes:
> On Tue, Mar 03, 2020 at 06:37:36PM -0500, David Steele wrote:
>> It seems like an explicit cast to uint16 would be better?

> Attempting to compile the backend code with -Wconversion leads to many
> warnings, still there has been at least one fix in the past to ease
> the use of the headers in this case, with b5b3229 (this made the code
> more readable). Should we really care about this case?

Per the commit message for b5b3229, it might be worth getting rid of
such messages for code that's exposed in header files, even if removing
all of those warnings would be too much work. Perhaps David's use-case
is an extension that's using that header?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mahendra Singh Thalor 2020-03-04 06:15:12 Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager
Previous Message Dilip Kumar 2020-03-04 05:45:52 Re: logical replication empty transactions