Hello Alexey Serbin, Kudu Jenkins,

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/23055

to look at the new patch set (#2).

Change subject: [util] eliminate compiler warnings in RLE encoding debug checks
......................................................................

[util] eliminate compiler warnings in RLE encoding debug checks

This patch resolves two categories of compiler warnings in RLE encoding
that were discovered during Rocky Linux compilation and also exist in CentOS:

1. Boolean comparison warnings (-Wbool-compare):
   For T=bool and BIT_WIDTH=1, the debug check "value < (1LL << BIT_WIDTH)"
   (which evaluates to "value < 2") is always true for boolean values (0 or 1),
   triggering warnings like:
`
/data/code/kudu/src/kudu/util/rle-encoding.h:388:37:
warning: comparison of constant '2' with boolean expression is always true
[-Wbool-compare]
DCHECK(value < (1LL << BIT_WIDTH));
~~~~~^~~~~~~~~~~~~~~~~~~~
`
2. Shift overflow warnings (-Wshift-count-overflow):
For BIT_WIDTH=64, the expression (1LL << 64) causes undefined behavior
by shifting beyond long long's bit width, triggering warnings like:
`
/data/code/kudu/src/kudu/util/rle-encoding.h:388:44:
warning: left shift count >= width of type [-Wshift-count-overflow]
DCHECK(value < (1LL << BIT_WIDTH));
~~~~^~~~~~~~~~~~~
`

Change-Id: I230fb92acb18aeda29766f2f131beac9eca8dab9
---
M src/kudu/util/rle-encoding.h
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/55/23055/2
--
To view, visit http://gerrit.cloudera.org:8080/23055
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I230fb92acb18aeda29766f2f131beac9eca8dab9
Gerrit-Change-Number: 23055
Gerrit-PatchSet: 2
Gerrit-Owner: KeDeng <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)

Reply via email to