On Fri, Jul 11, 2025 at 7:18 PM Japin Li <japinli@hotmail.com> wrote:
>
...
>
> Hi, Peter
>
> 1.
> I'm curious if you encountered the following warning during compilation:
>
> /home/japin/Codes/pg/master/build/../contrib/vci/include/vci_ros.h:745:9: warning: result of comparison of constant
65536with expression of type 'OffsetNumber' (aka 'unsigned short') is always true
[-Wtautological-constant-out-of-range-c
> ompare]
> 745 | return vci_MakeUint64FromBlockNumberAndOffset(blockNumber, item->ip_posid);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /home/japin/Codes/pg/master/build/../contrib/vci/include/vci_ros.h:639:19: note: expanded from macro
'vci_MakeUint64FromBlockNumberAndOffset'
> 638 | (AssertMacro((0 <= (offset)) \
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 639 | && ((offset) < (1U << (BITS_PER_BYTE * sizeof(OffsetNumber))))), \
> | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /home/japin/Codes/pg/master/build/../src/include/c.h:868:12: note: expanded from macro 'AssertMacro'
> 868 | ((void) ((condition) || \
> | ^~~~~~~~~
> 1 warning generated.
>
> Since the offset is unsigned, we can infer it's always non-negative. Did I miss
> anything?
>
Yeah, I don't see warnings in my build environment, but OTOH we are
aware there are a number of compiler warnings that are reported by the
cfbot [1]. That one you cited above is just another one of them.
Addressing all the cfbot compiler warnings in patch 0002 is certainly
on the to-do list.
======
[1] https://cirrus-ci.com/task/5631634596167680
Kind Regards,
Peter Smith.
Fujitsu Australia